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 field type decimal convert to String #4954

Closed
samz406 opened this issue Apr 10, 2019 · 7 comments
Closed

Mysql field type decimal convert to String #4954

samz406 opened this issue Apr 10, 2019 · 7 comments
Assignees
Labels
comp-foreign-db Integrations with other databases comp-mysql feature

Comments

@samz406
Copy link

samz406 commented Apr 10, 2019

hello! I use command ,extract data from Mysql.
CREATE table sales_fact_sample_flat_1 ENGINE=MergeTree order by the_year AS SELECT * FROM mysql(192.168.103.44:3306, cboard,sales_fact_sample_flat, root,admin);
I found a problem that the field of mysql decimal convert string.

mysql
image

clickhouse
image

Is that right?

@samz406 samz406 added the question Question? label Apr 10, 2019
@4ertus2
Copy link
Contributor

4ertus2 commented Apr 10, 2019

Decimal conversion for external storages and dictionaries is not supported yet.
As workaround you may try to create Decimal ALIAS columns for Strings ones with toDecimal() expression.

@4ertus2 4ertus2 self-assigned this Apr 10, 2019
@samz406
Copy link
Author

samz406 commented Apr 11, 2019

ok,I have another question. mysql can be use
mysql(192.168.103.44:3306, cboard,sales_fact_sample_flat, root,admin),
this is convenience, it can be auto create table and insert data. So i want to extract data from oracle to clckhouse,can you give me some advise? soon I want extract source data from db2, mogodb,Postgres hdfs and so on!

@4ertus2 4ertus2 removed their assignment Apr 12, 2019
@4ertus2
Copy link
Contributor

4ertus2 commented Apr 12, 2019

There're external dictionaries https://clickhouse.yandex/docs/en/operations/table_engines/dictionary/

There're also readonly ODBC/JDBC engines. But they are still not in docs. You may configure odbc.ini and then create table with ENGINE = odbc('dsn=test', table). It uses unixodbc under the hood.

@samz406 samz406 closed this as completed Apr 16, 2019
@filimonov
Copy link
Contributor

filimonov commented May 8, 2019

Reopening that, just to have it in backlog, and don't forget about that problem

@4ertus2
Copy link
Contributor

4ertus2 commented Jun 10, 2019

Same issue with enums #3985

@4ertus2
Copy link
Contributor

4ertus2 commented Jun 10, 2019

More general request #1270

@kitaisreal
Copy link
Collaborator

Fixed in scope of #11512.
With mysql_datatypes_support_level specified to decimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-foreign-db Integrations with other databases comp-mysql feature
Projects
None yet
Development

No branches or pull requests

5 participants