-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 #2863
Comments
+1 |
I don't think the last one is correct. Case insensitive matching should only happen if the target is the correct case. You can have multiple identifiers differing only in case. Case insensitive matching should match at most one. |
@electrum correct. I updated the description. |
Is there any plan to get this fixed so I could use Upper case in table name? |
Is there any other way to use upper case in database name and table name while querying from presto |
@ashish6976 This issues is about changing the current Presto behavior to support full case sensitive identifiers. From the users perspective, the current behavior of only supporting case insensitive identifiers should just work, unless you happen to have an existing system containing identifiers that only differ in case. If you are seeing failures when there is only one identifier, please file a new issue since that is a bug. |
@dain Here are the scenarios in which I am facing isssues My MYSQL Server is running on Centos. Scenario 1 - DataBase name and Table name is combination of upper case and lower case lettersDatabase Name - TestDB information_schema Query 20150818_064410_00003_837eu, FINISHED, 1 node Query 2 - show tables from mysql.testdb; (0 rows) Query 20150818_064532_00004_837eu, FINISHED, 1 node In this case presto is not able to Fetch the table names which are present in database TestDB. The Mysql output Scenario 2 - DataBase name is in lower case , Table name is combination of upper case and lower case lettersDatabase Name - lowercasedb information_schema Query 20150818_065347_00005_837eu, FINISHED, 1 node Query 2 - show tables from mysql.lowercasedb; tableone Query 20150818_065432_00006_837eu, FINISHED, 1 node Query 3 - select * from mysql.lowercasedb.tableone; In this scenario presto is able to fetch the table names but when I am accessing the table the its giving me an error as shown above. The Mysql output Scenario 3 - DataBase name and Table name is in lower case lettersDatabase Name - lowercasedb information_schema Query 20150818_070234_00008_837eu, FINISHED, 1 node Query 2 - show tables from mysql.lowercasetabledb; tableone Query 20150818_070253_00009_837eu, FINISHED, 1 node Query 3 - select * from mysql.lowercasetabledb.tableone; Query 20150818_070319_00010_837eu, FINISHED, 1 node In this scenario I am able to access the tables in the database. |
@ashish6976 This is a bug in the mysql connector. Please open a new issue for the mysql connector. |
…d be reverted once prestodb#2863 is resolved.
…d be reverted once prestodb#2863 is resolved.
Any progress on this? |
I have the same issue as @ashish6976 but in my case the database is MongoDB. Some of the database names and collections are in title case per company standards. When Presto loads the catalog, it converts everything to lowercase and results in zero records being processed. The only thing that works is, when a collection name or database name is lowercase. Are there any alternative to overcome this? |
Any update about this ? |
I've read the source a bit. There are places in the Presto code like this I think we have to remove those toLowerCase(). |
Is there a fix for this? I'm not able to query upper case tables |
Any update about the fix? |
I am using 0.180 version of presto and issue is still present. We have all our mysql table names in UPPERCASE and any alternative or patches available..? |
Hi there, |
I'm testing out Presto with MySQL, running into this exact issue. Is there any will, at all, to fix this rather big issue? Clearly there's more than 1 or 2 people, and this would prevent us from using Presto as our tables are managed by Hibernate, which creates them. I have seen https://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html, which setting it to 2 might work. I'm having trouble getting my MySQL instance to get that set properly though, but I'll report back if I manage to and if that works. |
So, sadly I can't get it set to '2', I suppose it's because I'm running on Linux, and so mysql really doesn't like it so it keeps reverting to 0. I can get it set to 1, which simply lowercases all table names and stores them on disk as lowercased, but that's not so useful for lots of existing tables. |
For reference, here are the relevant parts from the SQL spec:
|
+1 |
I have an open PR #8674 that got stalled waiting for some replies from maintainers, and then I got busy with work and unable to continue it. I don't see any time in the foreseeable future for me to pick this back up. |
This is still an issue currently. Is there any alternative available? |
Any update ? |
Unfortunately, no ;( |
@hgschmie told me the other day he was looking at this |
Any update on this? All the tables in my project are by default in upper case. |
any update? hive metastore tables in mysql like DBS, PARTITIONS can't be queried. presto> select * from mysql.metastore.DBS; |
Any updae on this issue? My collections in mongodb have names with upper case. Presto can't read these collections because it always change lower case. |
I'm getting the same issue with Sqlserver connectors and tables defined in uppercase... ( only be able to query tables where names are defined in lower case.... :-( (presto 0.203) |
I no longer am actively working on Presto |
Any update on this? Thanks in advance. |
Fixed at Release 0.225. JDBC ChangesMatch schema and table names case insensitively. This behavior can be enabled by setting the |
I have a table that that only differ by case,for example ,columns ‘toPkgVErsName ' and ‘ toPkGVersName‘ . I can execute with 'select topkgversname from ......' correctly when i use hive.But the same sql in presto will be wrong (I use hue to connect with hive and presto). Multiple entries with same key: [topkgversname] required binary topkgversname (STRING)=min: , max: , num_nulls: 0 and [topkgversname] required binary topkgversname (STRING)=min: , max: walleve-1.0.269.171227.eaddc8f, num_nulls: 0 at io.prestosql.jdbc.AbstractPrestoResultSet.resultsException(AbstractPrestoResultSet.java:1731) at io.prestosql.jdbc.PrestoResultSet$ResultsPageIterator.computeNext(PrestoResultSet.java:216) at io.prestosql.jdbc.PrestoResultSet$ResultsPageIterator.computeNext(PrestoResultSet.java:176) at io.prestosql.jdbc.$internal.guava.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) at io.prestosql.jdbc.$internal.guava.collect.AbstractIterator.hasNext(AbstractIterator.java:136) at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811) at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:295) at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:207) at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:162) at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:301) at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681) at io.prestosql.jdbc.PrestoResultSet$AsyncIterator.lambda$new$0(PrestoResultSet.java:122) at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Is there any setting that could fix this problem? |
@yys12138 It seems you are using Trino formerly PrestoSQL. The right repository is https://github.com/trinodb/trino and you can ask questions in the community Slack. https://trino.io/slack.html |
The text was updated successfully, but these errors were encountered: