Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for case sensitive identifiers #2350

Closed

Conversation

Praveen2112
Copy link
Member

Relates to #17.
Supersedes #1302.

@cla-bot cla-bot bot added the cla-signed label Dec 26, 2019
@Praveen2112 Praveen2112 force-pushed the case_sensitive_identifiers_4 branch 2 times, most recently from bcd9eb1 to 844afe7 Compare December 26, 2019 10:04
Copy link
Member

@martint martint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments

@Praveen2112 Praveen2112 force-pushed the case_sensitive_identifiers_4 branch 3 times, most recently from af6c013 to 9b32865 Compare January 26, 2020 14:32
@Praveen2112
Copy link
Member Author

@martint Thanks for your insights. Have applied the comments

@zifer123
Copy link

I have this problem, and, any update about this?
I hope this problem can be solved

Copy link
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would squash all commits together. It is not clear what is the boundary between them and that way it will be easier for you to iterate.

import static java.util.Locale.ENGLISH;
import static java.util.Objects.requireNonNull;

public class NamePart
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please implement toString() in a way it throws an exception.

@JsonCreator
public NamePart(@JsonProperty("value") String value, @JsonProperty("delimited") boolean delimited)
{
checkArgument(!value.isEmpty(), "value is empty");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rnn(value)

import static java.util.Locale.ENGLISH;
import static java.util.Objects.requireNonNull;

public class NamePart
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier?

{
Optional<CatalogMetadata> metadata = getOptionalCatalogMetadata(session, catalogName);
if (metadata.isPresent()) {
return (identifier, delimited) -> metadata.get().getMetadata().canonicalize(session.toConnectorSession(metadata.get().getCatalogName()), identifier, delimited);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is functional? I would simply convert getNameCanonicalizer to canonicalize

* Canonicalizes the provided SQL identifier according to connector-specific rules
* for the purpose of providing the name in metadata APIs
*/
default String canonicalize(ConnectorSession session, String identifier, boolean delimited)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can skip passing session here. The way how remote data source is typically static and it should not change at runtime.
Also this will make this change easier. If we ever hit a use case where session is needed we can always add it then, it should be easy change.

@@ -67,7 +67,7 @@ public void setUp()
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add plenty of tests to BaseConnectorTest.

Things to cover:

  • whether output column aliases for remain their case
  • CREATE TABLE with case sensitive names
  • CREATE TABLE with columns that differs only with casing, do select, insert, update, delete from from that table
  • The similar like above with columns, but for schemas and catalogs.

@kokosing
Copy link
Member

I would squash all commits together.

% method and classes renames and other mechanical refactorings.

@bitsondatadev
Copy link
Member

@Praveen2112 and @kokosing - this PR has become inactive. If you're still interested in working on it, please let us know.

We're working on closing out old and inactive PRs, so if you're too busy or this has too many merge conflicts to be worth picking back up, we'll be making another pass to close it out in a few weeks.

@colebow colebow closed this Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants