File tree Expand file tree Collapse file tree
ingestion/src/metadata/ingestion/source/database/hive Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,21 +198,20 @@ def _get_partition_keys_from_describe(
198198 ) -> List [str ]:
199199 partition_keys : List [str ] = []
200200 in_partition_section = False
201- with self .engine .connect () as conn :
202- rows = conn .execute (
203- text (f"DESCRIBE FORMATTED `{ schema_name } `.`{ table_name } `" )
204- )
205- for row in rows :
206- col_name = row [0 ].strip () if row [0 ] else ""
207- if col_name == "# Partition Information" :
208- in_partition_section = True
201+ rows = self .connection .execute (
202+ text (f"DESCRIBE FORMATTED `{ schema_name } `.`{ table_name } `" )
203+ )
204+ for row in rows :
205+ col_name = row [0 ].strip () if row [0 ] else ""
206+ if col_name == "# Partition Information" :
207+ in_partition_section = True
208+ continue
209+ if in_partition_section :
210+ if not col_name or col_name .startswith ("# Detailed" ):
211+ break
212+ if col_name .startswith ("#" ):
209213 continue
210- if in_partition_section :
211- if not col_name or col_name .startswith ("# Detailed" ):
212- break
213- if col_name .startswith ("#" ):
214- continue
215- partition_keys .append (col_name )
214+ partition_keys .append (col_name )
216215 return partition_keys
217216
218217 def get_table_partition_details ( # pylint: disable=unused-argument
You can’t perform that action at this time.
0 commit comments