-
Notifications
You must be signed in to change notification settings - Fork 40
feat(connectors): BI-6585 Add column tables support for YDB #1249
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
base: main
Are you sure you want to change the base?
Changes from all commits
ba5bcbd
8baa9a7
5bac193
8e36e93
602fc49
4a71578
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -79,6 +79,35 @@ class CoreSslConnectionSettings: | |||||
| ("some_timestamp", UserDataType.genericdatetime, sa.TIMESTAMP), | ||||||
| ("some_interval", UserDataType.integer, dl_sqlalchemy_ydb.dialect.YqlInterval), | ||||||
| ) | ||||||
|
|
||||||
| COLUMN_TABLE_SCHEMA = ( | ||||||
| ("id", UserDataType.integer, sa.Integer), | ||||||
| ("distinct_string", UserDataType.string, sa.String), | ||||||
| ("some_int32", UserDataType.integer, sa.Integer), | ||||||
| ("some_int64", UserDataType.integer, sa.BigInteger), | ||||||
| ("some_uint8", UserDataType.integer, sa.SmallInteger), | ||||||
| ("some_double", UserDataType.float, sa.Float), | ||||||
| ("some_string", UserDataType.string, sa.String), | ||||||
| ("some_utf8", UserDataType.string, sa.Unicode), | ||||||
| ("some_date", UserDataType.date, sa.Date), | ||||||
| ("some_datetime", UserDataType.genericdatetime, sa.DATETIME), | ||||||
| ("some_timestamp", UserDataType.genericdatetime, sa.TIMESTAMP), | ||||||
| ) | ||||||
|
|
||||||
| SA_TYPE_TO_YDB_TYPE_NAME = { | ||||||
| sa.Integer: "Int32", | ||||||
| sa.String: "String", | ||||||
| sa.BigInteger: "Int64", | ||||||
| sa.SmallInteger: "Int8", | ||||||
| sa.Boolean: "Bool", | ||||||
| sa.Float: "Double", | ||||||
| sa.Unicode: "Utf8", | ||||||
| sa.Date: "Date", | ||||||
| sa.DATETIME: "Datetime", | ||||||
| sa.TIMESTAMP: "Timestamp", | ||||||
| dl_sqlalchemy_ydb.dialect.YqlInterval: "Interval", | ||||||
| } | ||||||
|
|
||||||
| TABLE_DATA = [ | ||||||
| { | ||||||
| "id": 1, | ||||||
|
|
@@ -246,8 +275,13 @@ class CoreSslConnectionSettings: | |||||
| "some_interval": 1234, | ||||||
| }, | ||||||
| ] | ||||||
|
|
||||||
| # Leave only values in COLUMN_TABLE_SCHEMA | ||||||
| COLUMN_TABLE_DATA = [{key: value for key, value in row.items() if key in COLUMN_TABLE_SCHEMA} for row in TABLE_DATA] | ||||||
|
||||||
| COLUMN_TABLE_DATA = [{key: value for key, value in row.items() if key in COLUMN_TABLE_SCHEMA} for row in TABLE_DATA] | |
| COLUMN_TABLE_DATA = [{key: value for key, value in row.items() if key in {col[0] for col in COLUMN_TABLE_SCHEMA}} for row in TABLE_DATA] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TABLE_DATA contains columns not present in COLUMN_TABLE_SCHEMA (e.g., 'some_bool', 'some_interval'). This will cause insertion to fail. Use COLUMN_TABLE_DATA instead of TABLE_DATA.