Skip to content

Commit 5b49405

Browse files
improve logging
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent ea79bc8 commit 5b49405

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/databricks/sql/cloud_fetch_queue.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def __init__(
318318

319319
self._sea_client = sea_client
320320
self._statement_id = statement_id
321-
self._total_chunk_count = total_chunk_count
322321

323322
logger.debug(
324323
"SeaCloudFetchQueue: Initialize CloudFetch loader for statement {}, total chunks: {}".format(
@@ -342,12 +341,6 @@ def __init__(
342341

343342
# Initialize table and position
344343
self.table = self._create_next_table()
345-
if self.table:
346-
logger.debug(
347-
"SeaCloudFetchQueue: Initial table created with {} rows".format(
348-
self.table.num_rows
349-
)
350-
)
351344

352345
def _convert_to_thrift_link(self, link: "ExternalLink") -> TSparkArrowResultLink:
353346
"""Convert SEA external links to Thrift format for compatibility with existing download manager."""
@@ -357,7 +350,6 @@ def _convert_to_thrift_link(self, link: "ExternalLink") -> TSparkArrowResultLink
357350

358351
# Parse the ISO format expiration time
359352
expiry_time = int(dateutil.parser.parse(link.expiration).timestamp())
360-
361353
return TSparkArrowResultLink(
362354
fileLink=link.external_link,
363355
expiryTime=expiry_time,
@@ -369,9 +361,10 @@ def _convert_to_thrift_link(self, link: "ExternalLink") -> TSparkArrowResultLink
369361

370362
def _progress_chunk_link(self):
371363
"""Progress to the next chunk link."""
364+
372365
next_chunk_index = self._current_chunk_link.next_chunk_index
373-
self._current_chunk_link = None
374366

367+
self._current_chunk_link = None
375368
try:
376369
self._current_chunk_link = self._sea_client.get_chunk_link(
377370
self._statement_id, next_chunk_index
@@ -382,6 +375,9 @@ def _progress_chunk_link(self):
382375
next_chunk_index, e
383376
)
384377
)
378+
logger.debug(
379+
f"SeaCloudFetchQueue: Progressed to link for chunk {next_chunk_index}: {self._current_chunk_link}"
380+
)
385381

386382
def _create_next_table(self) -> Union["pyarrow.Table", None]:
387383
"""Create next table by retrieving the logical next downloaded file."""

0 commit comments

Comments
 (0)