Repository navigation
[Python] Support Lakehouse runtime catalog tables in ReadFromBigQuery… - #40225
Conversation
… DIRECT_READ Port of the Java change in apache#39597 to the Python SDK. - parse_table_reference now assigns segments by explicit splitting (mirroring BigQueryHelpers.parseTableSpec) so 4-part `project.catalog.namespace.table` and `project:catalog.namespace.table` specs map to a composite `catalog.namespace` dataset id. Previously the dotted form raised and the colon form silently bound the project to `project:catalog`. - Storage Read split tolerates tables that report no numBytes by requesting zero streams so the Read API picks the stream count; the export source's size estimate returns 0 instead of raising. - Unit tests for the new spec forms, domain-scoped projects, invalid specs, and the numBytes-missing paths.
f5dbd12 to
576282a
Compare
|
Assigning reviewers: R: @tvalentyn for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
| @@ -29,7 +29,10 @@ | |||
| Also, for programming convenience, instances of TableReference and TableSchema | |||
| have a string representation that can be used for the corresponding arguments: | |||
|
|
|||
| - TableReference can be a PROJECT:DATASET.TABLE or DATASET.TABLE string. | |||
| - TableReference can be a PROJECT:DATASET.TABLE, PROJECT.DATASET.TABLE or | |||
| DATASET.TABLE string. Lakehouse runtime catalog (BigLake metastore) tables | |||
There was a problem hiding this comment.
Since this is new functionality, can we force a standard format without dot/colon ambiguity and without potentially ambiguous parsing (project.dataset.table vs [no_project].catalog.namespace.table)? For example we could change the docstring to:
TableReference can be a PROJECT:DATASET.TABLE, PROJECT.DATASET.TABLE, DATASET.TABLE, or PROJECT.CATALOG.NAMESPACE.TABLE (for Lakehouse catalog tables).
There was a problem hiding this comment.
I dont see a way we can force a standard format.
table is just a string, so we only find out whether it's a 3-part or 4-part
reference by parsing it.
We also can't drop the colon form. get_hashable_destination converts a
TableReference into PROJECT:DATASET.TABLE as the canonical string representation.
So we need colon because of get_hashable_destination, and dot because it's the
modern SQL form we want to encourage. Deprecating colon would be nice, but it's the
destination key throughout the write path, so that's a bigger breaking change.
Updated the docs to mention that project is required for pcnt format
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40225 +/- ##
============================================
+ Coverage 58.65% 58.67% +0.02%
Complexity 13843 13843
============================================
Files 2579 2581 +2
Lines 270366 271356 +990
Branches 11212 11212
============================================
+ Hits 158587 159224 +637
- Misses 105747 106100 +353
Partials 6032 6032
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
thanks! |
… DIRECT_READ
Port of the Java change in #39597 to the Python SDK.
project.catalog.namespace.tableandproject:catalog.namespace.tablespecs map to a compositecatalog.namespacedataset id. Previously the dotted form raised and the colon form silently bound the project toproject:catalog.Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.