mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +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 | ||||
|                 ) | ||||
|             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( | ||||
|                     table_id=created_table.id, | ||||
|                     table_profile=table_and_db.table.tableProfile, | ||||
|  | ||||
| @ -177,7 +177,9 @@ class SQLSource(Source): | ||||
|             query = self.config.query.format(schema, table) | ||||
|             logger.info(query) | ||||
|             results = self.connection.execute(query) | ||||
|             cols = list(results.keys()) | ||||
|             cols = [] | ||||
|             for col in results.keys(): | ||||
|                 cols.append(col.replace(".", "_DOT_")) | ||||
|             rows = [] | ||||
|             for r in results: | ||||
|                 row = list(r) | ||||
| @ -347,7 +349,8 @@ class SQLSource(Source): | ||||
|         try: | ||||
|             for column in columns: | ||||
|                 if "." in column["name"]: | ||||
|                     continue | ||||
|                     logger.info(f"Found '.' in {column['name']}") | ||||
|                     column["name"] = column["name"].replace(".", "_DOT_") | ||||
|                 children = None | ||||
|                 data_type_display = None | ||||
|                 col_data_length = None | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Vijlbrief
						Tom Vijlbrief