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

ISSUES-3985 Support MySQL engine reading Enums type #11996

Merged
merged 3 commits into from
Jun 27, 2020

Conversation

BohuTANG
Copy link
Contributor

@BohuTANG BohuTANG commented Jun 27, 2020

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Support MySQL engine reading Enums type #3985

@blinkov blinkov added the pr-improvement Pull request with some product improvements label Jun 27, 2020
@BohuTANG BohuTANG changed the title ISSUES-3985 MySQL engine enums type ISSUES-3985 Support MySQL engine reading Enums type Jun 27, 2020
node1.query('''
CREATE TABLE {}(id UInt32, name String, age UInt32, money UInt32, source Enum8('IP' = 1, 'URL' = 2)) ENGINE = MySQL('mysql1:3306', 'clickhouse', '{}', 'root', 'clickhouse', 1);
'''.format(table_name, table_name))
node1.query("INSERT INTO {}(id, name, age, money) VALUES (1,'name',0, 0)".format(table_name))
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to INSERT source (enum column)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me have a go

@alexey-milovidov alexey-milovidov self-assigned this Jun 27, 2020
Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

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

Ok.

BTW, we can also convert Enum to Enum, it will be more efficient. But it's not needed in this PR.

@BohuTANG
Copy link
Contributor Author

Yes.
That's the universal solution for all the external engines(mongodb, cassandra etc) if they have Enum types.
Since mysqlxx(other storage driver) returns real enum string result not the enum type value, so need more works to do with it(need convert the string result to the Enum8 index)

@BohuTANG
Copy link
Contributor Author

BTW, thanks for giving 'can be tested' free pass.

@alexey-milovidov
Copy link
Member

Integration tests

Broken in #11903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants