claudevdm commented on code in PR #40225:
URL: https://github.com/apache/beam/pull/40225#discussion_r4170157932
##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1256,14 +1265,18 @@ def split(self, desired_bundle_size,
start_position=None, stop_position=None):
requested_session.read_options.row_restriction = self.row_restriction
storage_client = bq_storage.BigQueryReadClient()
+ # A stream_count of 0 lets the Storage Read API choose the number of
+ # streams; used when the table reports no size (e.g. Lakehouse runtime
+ # catalog tables).
stream_count = 0
- if desired_bundle_size > 0:
- table_size = self._get_table_size(bq, self.table_reference)
- stream_count = min(
- int(table_size / desired_bundle_size),
- _CustomBigQueryStorageSource.MAX_SPLIT_COUNT)
- stream_count = max(
- stream_count, _CustomBigQueryStorageSource.MIN_SPLIT_COUNT)
+ table_size = self._get_table_size(bq, self.table_reference)
+ if table_size is not None:
Review Comment:
Done
##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -789,6 +792,10 @@ def estimate_size(self):
table_ref.projectId = self._get_project()
table = bq.get_table(
table_ref.projectId, table_ref.datasetId, table_ref.tableId)
+ if table.numBytes is None:
+ # Tables that don't report storage statistics, e.g. Lakehouse runtime
+ # catalog (BigLake metastore) tables.
+ return 0
Review Comment:
Done. Has the same effect, this evaluates as falsy donwstream
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]