Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add support for case sensitive identifiers #2863
Comments
cberner
commented
May 4, 2015
|
|
+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. |
Based on needs in issue prestodb#2863, where in RDBMS that supports case-sensitive table names and have tables with case-sensitive names, then those tables are unable to be used with PrestoDB. This change adds optional (configuration controlled) mapping for table names when executing queries that end up calling getTableHandle(). It maps a lowercased name to the name of the table from the database, and supports reloading the mapping in the event that a table is referenced but doesn't currently have a mapping so new tables can be used without restarting Presto. A test was attempted to be written similar to the TestJdbcClient with a new TestingDatabase, however it was discovered that H2 will return TRUE for metadata.storesUpperCaseIdentifiers() even if DATABASE_TO_UPPER=FALSE is set. The only way to have that return FALSE is using MODE=MYSQL, however in that case H2 lowercases all table names. So it is not possible to create a test with H2 without modifying the section of code with the call to metadata.storesUpperCaseIdentifiers().
|
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. |