Support SingleStore metadata ingestion (JSON type fields) (#12623)

* Support SingleStore metadata ingestion (JSON type fields)

* Removing Collate Keyword all datatypes

---------

Co-authored-by: Vanshika Kabra <vanshikakabra@Vanshikas-MacBook-Pro.local>
Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com>
This commit is contained in:
vanshika18 2023-07-30 00:57:05 +05:30 committed by GitHub
parent 786dde170e
commit a0dd821bd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ def parse_column(self, line, state):
name, type_, args = spec["name"], spec["coltype"], spec["arg"] name, type_, args = spec["name"], spec["coltype"], spec["arg"]
try: try:
col_type = self.dialect.ischema_names[type_] col_type = self.dialect.ischema_names[type_.lower()]
except KeyError: except KeyError:
util.warn(f"Did not recognize type '{type_}' of column '{name}'") util.warn(f"Did not recognize type '{type_}' of column '{name}'")
col_type = sqltypes.NullType col_type = sqltypes.NullType
@ -88,9 +88,9 @@ def parse_column(self, line, state):
for ikw in ("unsigned", "zerofill"): for ikw in ("unsigned", "zerofill"):
if spec.get(ikw, False): if spec.get(ikw, False):
type_kw[ikw] = True type_kw[ikw] = True
for ikw in ("charset", "collate"): if spec.get("charset", False):
if spec.get(ikw, False): type_kw["charset"] = spec["charset"]
type_kw[ikw] = spec[ikw]
if issubclass(col_type, (ENUM, SET)): if issubclass(col_type, (ENUM, SET)):
type_args = _strip_values(type_args) type_args = _strip_values(type_args)