mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-03 14:47:59 +00:00
Handle . in column names (#989)
* Handle . in column names * Handle . for profiling
This commit is contained in:
parent
9b7d3e313f
commit
0c23b68d40
@ -160,6 +160,11 @@ class MetadataRestSink(Sink):
|
|||||||
table_id=created_table.id, sample_data=table_and_db.table.sampleData
|
table_id=created_table.id, sample_data=table_and_db.table.sampleData
|
||||||
)
|
)
|
||||||
if table_and_db.table.tableProfile is not None:
|
if table_and_db.table.tableProfile is not None:
|
||||||
|
for tp in table_and_db.table.tableProfile:
|
||||||
|
for pd in tp:
|
||||||
|
if pd[0] == "columnProfile":
|
||||||
|
for col in pd[1]:
|
||||||
|
col.name = col.name.replace(".", "_DOT_")
|
||||||
self.client.ingest_table_profile_data(
|
self.client.ingest_table_profile_data(
|
||||||
table_id=created_table.id,
|
table_id=created_table.id,
|
||||||
table_profile=table_and_db.table.tableProfile,
|
table_profile=table_and_db.table.tableProfile,
|
||||||
|
@ -177,7 +177,9 @@ class SQLSource(Source):
|
|||||||
query = self.config.query.format(schema, table)
|
query = self.config.query.format(schema, table)
|
||||||
logger.info(query)
|
logger.info(query)
|
||||||
results = self.connection.execute(query)
|
results = self.connection.execute(query)
|
||||||
cols = list(results.keys())
|
cols = []
|
||||||
|
for col in results.keys():
|
||||||
|
cols.append(col.replace(".", "_DOT_"))
|
||||||
rows = []
|
rows = []
|
||||||
for r in results:
|
for r in results:
|
||||||
row = list(r)
|
row = list(r)
|
||||||
@ -347,7 +349,8 @@ class SQLSource(Source):
|
|||||||
try:
|
try:
|
||||||
for column in columns:
|
for column in columns:
|
||||||
if "." in column["name"]:
|
if "." in column["name"]:
|
||||||
continue
|
logger.info(f"Found '.' in {column['name']}")
|
||||||
|
column["name"] = column["name"].replace(".", "_DOT_")
|
||||||
children = None
|
children = None
|
||||||
data_type_display = None
|
data_type_display = None
|
||||||
col_data_length = None
|
col_data_length = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user