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

Mysql connector cannot retrieve tables which includes underscore in table name #4983

Closed
darkrwe opened this issue Apr 11, 2016 · 6 comments
Closed
Assignees

Comments

@darkrwe
Copy link

darkrwe commented Apr 11, 2016

presto-server-0.139 still have mysql connector problem .

Create database in mysql:

CREATE DATABASE TUTORIAL_1;
USE TUTORIAL_1;
CREATE TABLE USERS (userid VARCHAR(15), gender CHAR(1), Age SMALLINT,country VARCHAR(50), SIGN_UP VARCHAR(50));

presto> SHOW TABLES FROM mysql.TUTORIAL_1;

Table

(0 rows)

Query 20160301_082814_00005_fjdbm, FINISHED, 2 nodes
Splits: 2 total, 2 done (100.00%)
0:00 [0 rows, 0B] [0 rows/s, 0B/s]

@petroav
Copy link
Contributor

petroav commented Apr 11, 2016

@darkrwe this should have been fixed in dbd9288 so I don't know why you're running into this.

@kokosing when you get a chance, can you take a look since you have the most context?

@kokosing
Copy link
Contributor

I reproduced that. Which is strange as dbd9288 have tests for that case and it is passing. I need to investigate this.

@martint Can you please assign me to this issue, I will fix it.

@kokosing
Copy link
Contributor

Somehow it is related with capital letters:
mysql:

mysql> create database UPPER;
Query OK, 1 row affected (0,00 sec)

mysql> use UPPER;
Database changed
mysql> create table lower (a int);
Query OK, 0 rows affected (0,03 sec)

mysql> create table UPPER (a int);
Query OK, 0 rows affected (0,03 sec)

presto:

presto> show tables from mysql.upper;
 Table
-------
(0 rows)

@kokosing
Copy link
Contributor

For sure it is related with capital letters in mysql database name. Here is a test to reproduce the problem: kokosing/trino@c94675f

@martint Currently presto converts all the schema (database) names to lower case. Therefore when source database have different name casing (? I am not sure this word) presto is losing mapping between its schema and source schema. This also leads to ambiguities errors when source database have two schemas which differ only in letter casing. In order to fix that issue we would need to make presto to be case sensitive. It could be done in the same way as other databases do: quoted name - case sensitive, not quoted case insensitive. If you agree I will create an issue for that.

@darkrwe As a workaround you can use 'tutorial_1' instead of 'TUTORIAL_1' and your queries should work.

@cberner
Copy link
Contributor

cberner commented Apr 12, 2016

Yep, it's a known issue that Presto only supports lowercase identifiers: #2863

@kokosing
Copy link
Contributor

@cberner We could close this as a duplicate.

@cberner cberner closed this as completed Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants