Skip to content

Commit b8e39e2

Browse files
Merge branch 'sea-migration' into sea-norm-cols
2 parents 004bcce + 80692e3 commit b8e39e2

32 files changed

+1032
-615
lines changed

examples/experimental/tests/test_sea_sync_query.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ def test_sea_sync_query_with_cloud_fetch():
7272
f"{actual_row_count} rows retrieved against {requested_row_count} requested"
7373
)
7474

75+
# Verify total row count
76+
if actual_row_count != requested_row_count:
77+
logger.error(
78+
f"FAIL: Row count mismatch. Expected {requested_row_count}, got {actual_row_count}"
79+
)
80+
return False
81+
7582
# Close resources
7683
cursor.close()
7784
connection.close()
@@ -132,15 +139,27 @@ def test_sea_sync_query_without_cloud_fetch():
132139
# For non-cloud fetch, use a smaller row count to avoid exceeding inline limits
133140
requested_row_count = 100
134141
cursor = connection.cursor()
135-
logger.info("Executing synchronous query without cloud fetch: SELECT 100 rows")
142+
logger.info(
143+
f"Executing synchronous query without cloud fetch: SELECT {requested_row_count} rows"
144+
)
136145
cursor.execute(
137146
"SELECT id, 'test_value_' || CAST(id as STRING) as test_value FROM range(1, 101)"
138147
)
139148

140149
results = [cursor.fetchone()]
141150
results.extend(cursor.fetchmany(10))
142151
results.extend(cursor.fetchall())
143-
logger.info(f"{len(results)} rows retrieved against 100 requested")
152+
actual_row_count = len(results)
153+
logger.info(
154+
f"{actual_row_count} rows retrieved against {requested_row_count} requested"
155+
)
156+
157+
# Verify total row count
158+
if actual_row_count != requested_row_count:
159+
logger.error(
160+
f"FAIL: Row count mismatch. Expected {requested_row_count}, got {actual_row_count}"
161+
)
162+
return False
144163

145164
# Close resources
146165
cursor.close()

src/databricks/sql/backend/databricks_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def execute_command(
9696
max_rows: Maximum number of rows to fetch in a single fetch batch
9797
max_bytes: Maximum number of bytes to fetch in a single fetch batch
9898
lz4_compression: Whether to use LZ4 compression for result data
99-
cursor: The cursor object that will handle the results
99+
cursor: The cursor object that will handle the results. The command id is set in this cursor.
100100
use_cloud_fetch: Whether to use cloud fetch for retrieving large result sets
101101
parameters: List of parameters to bind to the query
102102
async_op: Whether to execute the command asynchronously
@@ -282,7 +282,9 @@ def get_tables(
282282
max_bytes: Maximum number of bytes to fetch in a single batch
283283
cursor: The cursor object that will handle the results
284284
catalog_name: Optional catalog name pattern to filter by
285+
if catalog_name is None, we fetch across all catalogs
285286
schema_name: Optional schema name pattern to filter by
287+
if schema_name is None, we fetch across all schemas
286288
table_name: Optional table name pattern to filter by
287289
table_types: Optional list of table types to filter by (e.g., ['TABLE', 'VIEW'])
288290
@@ -321,6 +323,7 @@ def get_columns(
321323
catalog_name: Optional catalog name pattern to filter by
322324
schema_name: Optional schema name pattern to filter by
323325
table_name: Optional table name pattern to filter by
326+
if table_name is None, we fetch across all tables
324327
column_name: Optional column name pattern to filter by
325328
326329
Returns:

0 commit comments

Comments
 (0)