-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Mixed case identifier support #24551
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
Changes from all commits
5806460
e98f00d
228c459
b61deea
df669d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.facebook.presto.plugin.jdbc; | ||
|
||
import com.facebook.presto.spi.WarningCode; | ||
import com.facebook.presto.spi.WarningCodeSupplier; | ||
|
||
public enum JdbcWarningCode | ||
implements WarningCodeSupplier | ||
{ | ||
USE_OF_DEPRECATED_CONFIGURATION_PROPERTY(1), | ||
/**/; | ||
private final WarningCode warningCode; | ||
|
||
public static final int WARNING_CODE_MASK = 0x0300_0000; | ||
|
||
JdbcWarningCode(int code) | ||
{ | ||
warningCode = new WarningCode(code + WARNING_CODE_MASK, name()); | ||
} | ||
|
||
@Override | ||
public WarningCode toWarningCode() | ||
{ | ||
return warningCode; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ public void testDefaults() | |
.setPasswordCredentialName(null) | ||
.setCaseInsensitiveNameMatching(false) | ||
.setCaseInsensitiveNameMatchingCacheTtl(new Duration(1, MINUTES)) | ||
.setlistSchemasIgnoredSchemas("information_schema")); | ||
.setlistSchemasIgnoredSchemas("information_schema") | ||
.setCaseSensitiveNameMatching(false)); | ||
} | ||
|
||
@Test | ||
|
@@ -51,6 +52,7 @@ public void testExplicitPropertyMappings() | |
.put("case-insensitive-name-matching", "true") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now there are two configs, one is existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. Existing
So And default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I feel now, even though the config names sounds appropriate but renaming currrent PR config to So I think it would be better to name the current PR configuration something different and then eventually we can deprecate exiting one. Let me know your thoughts around this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, thanks for clarifying. If all that can be achieved via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand the differences you pointed out between the two config keys, but from a user experience perspective this is very confusing. I think we need to make the new property name a little different or deprecate+change the name of the old one because the way it stands currently the names are too similar and it will be too easy for users to configure the wrong thing |
||
.put("case-insensitive-name-matching.cache-ttl", "1s") | ||
.put("list-schemas-ignored-schemas", "test,test2") | ||
.put("case-sensitive-name-matching", "true") | ||
.build(); | ||
|
||
BaseJdbcConfig expected = new BaseJdbcConfig() | ||
|
@@ -61,7 +63,8 @@ public void testExplicitPropertyMappings() | |
.setPasswordCredentialName("bar") | ||
.setCaseInsensitiveNameMatching(true) | ||
.setlistSchemasIgnoredSchemas("test,test2") | ||
.setCaseInsensitiveNameMatchingCacheTtl(new Duration(1, SECONDS)); | ||
.setCaseInsensitiveNameMatchingCacheTtl(new Duration(1, SECONDS)) | ||
.setCaseSensitiveNameMatching(true); | ||
|
||
ConfigAssertions.assertFullMapping(properties, expected); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ public final class CatalogSchemaName | |
public CatalogSchemaName(String catalogName, String schemaName) | ||
{ | ||
this.catalogName = requireNonNull(catalogName, "catalogName is null").toLowerCase(ENGLISH); | ||
this.schemaName = requireNonNull(schemaName, "schemaName is null").toLowerCase(ENGLISH); | ||
this.schemaName = requireNonNull(schemaName, "schemaName is null"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to normalize There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So here I kept it original then all the places like accesscontrol & MetadataManager where |
||
} | ||
|
||
@ThriftField(1) | ||
|
Uh oh!
There was an error while loading. Please reload this page.