Skip to content

Commit e78d16c

Browse files
authored
Added filter to speed up catalog check (#86)
* Added filter to speed up catalog check * Formatted dx
1 parent 89b24df commit e78d16c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

discoverx/dx.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(
4949

5050
def _can_read_columns_table(self) -> bool:
5151
try:
52-
self.spark.sql(f"SELECT * FROM {self.COLUMNS_TABLE_NAME} LIMIT 1")
52+
self.spark.sql(f"SELECT * FROM {self.COLUMNS_TABLE_NAME} WHERE table_catalog = 'system' LIMIT 1")
5353
return True
5454
except Exception as e:
5555
self.logger.error(f"Error while reading table {self.COLUMNS_TABLE_NAME}: {e}")
@@ -314,7 +314,8 @@ def select_by_classes(
314314
)
315315

316316
return self._msql(
317-
f"SELECT {from_statement}, to_json(struct(*)) AS row_content FROM {from_tables}", min_score=min_score
317+
f"SELECT {from_statement}, to_json(struct(*)) AS row_content FROM {from_tables}",
318+
min_score=min_score,
318319
)
319320

320321
def delete_by_class(

0 commit comments

Comments
 (0)