datastrato / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://datastrato.ai/docs/
Apache License 2.0
608 stars 193 forks source link

[Improvement] Support MySQL unsigned type mapping to gravitino type #2340

Closed hanwxx closed 5 hours ago

hanwxx commented 3 months ago

What would you like to be improved?

DDL SQL: CREATE TABLE test_type ( id int unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

screenshot-20240225-195026 MySQL type convertion Convert MySQL int unsigned type => gravitino Long type

How should we improve?

No response

SteNicholas commented 3 months ago

@hanwxx, all unsigned types are mapped to UnparsedType for Gravitino type. Therefore, this improvement should be MySQL supports unsigned data type.

hanwxx commented 3 months ago

@hanwxx, all unsigned types are mapped to UnparsedType for Gravitino type. Therefore, this improvement should be MySQL supports unsigned data type.

Got it, I'll change the title.

SteNicholas commented 3 months ago

@hanwxx, is this ticket duplicated with #2373?

hanwxx commented 3 months ago

@hanwxx, is this ticket duplicated with #2373?

yes, this issue can be closed.

xiacongling commented 3 months ago

it seems reasonable to map unsigned integer to long type for engines to read data from MySQL. it does the similar conversion when reading data via MySQL Connector/J. however, native type details should be added when defining tables, but it is not supported in Gravitino for now.