mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 01:15:08 +00:00
Co-authored-by: Mayur SIngal <mayursingal@Mayurs-MacBook-Pro.local>
This commit is contained in:
parent
dc2c7c0fb7
commit
c64f3fef34
@ -68,7 +68,8 @@
|
|||||||
"SET",
|
"SET",
|
||||||
"GEOGRAPHY",
|
"GEOGRAPHY",
|
||||||
"ENUM",
|
"ENUM",
|
||||||
"JSON"
|
"JSON",
|
||||||
|
"UUID"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"constraint": {
|
"constraint": {
|
||||||
|
@ -522,13 +522,15 @@ class SQLSource(Source[OMetaDatabaseAndTable]):
|
|||||||
repr(column["type"]), column["name"]
|
repr(column["type"]), column["name"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
col_data_length = (
|
|
||||||
1 if col_data_length is None else col_data_length
|
|
||||||
)
|
|
||||||
dataTypeDisplay = (
|
dataTypeDisplay = (
|
||||||
f"{data_type_display}"
|
f"{data_type_display}"
|
||||||
if data_type_display
|
if data_type_display
|
||||||
else "{}({})".format(col_type, col_data_length)
|
else "{}({})".format(col_type, col_data_length)
|
||||||
|
if col_data_length
|
||||||
|
else col_type
|
||||||
|
)
|
||||||
|
col_data_length = (
|
||||||
|
1 if col_data_length is None else col_data_length
|
||||||
)
|
)
|
||||||
om_column = Column(
|
om_column = Column(
|
||||||
name=column["name"],
|
name=column["name"],
|
||||||
|
@ -12,8 +12,10 @@
|
|||||||
import re
|
import re
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from sqlalchemy import exc, sql
|
from sqlalchemy import exc, sql, util
|
||||||
from sqlalchemy.engine import reflection
|
from sqlalchemy.engine import reflection
|
||||||
|
from sqlalchemy.sql import sqltypes
|
||||||
|
from sqlalchemy.sql.sqltypes import VARCHAR, String
|
||||||
from sqlalchemy_vertica.base import VerticaDialect
|
from sqlalchemy_vertica.base import VerticaDialect
|
||||||
|
|
||||||
from metadata.ingestion.ometa.openmetadata_rest import MetadataServerConfig
|
from metadata.ingestion.ometa.openmetadata_rest import MetadataServerConfig
|
||||||
@ -26,6 +28,13 @@ from metadata.utils.sql_queries import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class UUID(String):
|
||||||
|
|
||||||
|
"""The SQL UUID type."""
|
||||||
|
|
||||||
|
__visit_name__ = "UUID"
|
||||||
|
|
||||||
|
|
||||||
@reflection.cache
|
@reflection.cache
|
||||||
def get_columns(self, connection, table_name, schema=None, **kw):
|
def get_columns(self, connection, table_name, schema=None, **kw):
|
||||||
if schema is not None:
|
if schema is not None:
|
||||||
@ -129,7 +138,7 @@ def _get_column_info(
|
|||||||
args = ()
|
args = ()
|
||||||
elif charlen:
|
elif charlen:
|
||||||
args = (int(charlen),)
|
args = (int(charlen),)
|
||||||
|
self.ischema_names["UUID"] = UUID
|
||||||
if attype.upper() in self.ischema_names:
|
if attype.upper() in self.ischema_names:
|
||||||
coltype = self.ischema_names[attype.upper()]
|
coltype = self.ischema_names[attype.upper()]
|
||||||
else:
|
else:
|
||||||
|
@ -132,6 +132,7 @@ class ColumnTypeParser:
|
|||||||
"VARIANT": "JSON",
|
"VARIANT": "JSON",
|
||||||
"XML": "BINARY",
|
"XML": "BINARY",
|
||||||
"XMLTYPE": "BINARY",
|
"XMLTYPE": "BINARY",
|
||||||
|
"UUID": "UUID",
|
||||||
}
|
}
|
||||||
|
|
||||||
_COMPLEX_TYPE = re.compile("^(struct|map|array|uniontype)")
|
_COMPLEX_TYPE = re.compile("^(struct|map|array|uniontype)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user