Add ConnectorIdentifier to Connector#28359
Conversation
e363612 to
291d021
Compare
|
@wendigo Here's how it's possible to switch to mixed case with Trino while maintaining a minimum of backward compatibility. This requires more changes than expected and is only implemented for views. |
| public class ConnectorIdentifier | ||
| { | ||
| private final String value; | ||
| private final boolean delimited; |
There was a problem hiding this comment.
Names coming from connectors don't have a delimited / non-delimited characteristic. They are already canonicalized. The delimited characteristic only pertains to identifiers parsed from a SQL query, and matters only for deciding how to match identifiers to names.
There was a problem hiding this comment.
Names coming from connectors don't have a delimited / non-delimited characteristic.
Regarding the identifiers coming from the connectors, I agree. But here we're talking about identifiers coming from Trino tasks and destined for the connectors in order to execute the appropriate DDL commands.
If we want to be able to manage delimited and undelimited identifiers and compare them according to the underlying database rules. For example:
-
in HsqlDB (uppercase)
"PUBLIC".Table1is the same identifier aspublic."TABLE1" -
in SQLite (lowercase)
"main".Table1is the same identifier asMAIN."table1"
If we need to test whether a schema exists before its creation, I don't see any other way without using the ConnectorIdentifier class, which allows these comparisons between identifiers.
I'd like you to explain how you plan to solve this problem, because so far I haven't found anything better?
There was a problem hiding this comment.
@martint I think I understand what you were trying to tell me.
You're saying that Trino must normalize (ie: canonalize) all undelimited identifiers and that, therefore, all identifiers received by connectors must be considered as delimited identifiers.
Can you confirm this? Please excuse my lack of understanding.
|
I got a little sidetracked, I'm closing this. |
Description
I am trying to add a functional comparator for identifiers that support delimiters.
The new class
ConnectorIdentifieris intended to do so. It also allows the connector to know whether the DDL commands for which it is responsible should be executed with delimited identifiers or not.Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: