add count dataset python scipt - #19
Open
WangXuhongCN wants to merge 2 commits into
Open
Conversation
hsballoon
requested changes
Aug 14, 2026
| table=table, | ||
| verbose=verbose, | ||
| ): dataset | ||
| for index, dataset in enumerate(datasets) |
Collaborator
There was a problem hiding this comment.
too much full-table scans here. Cause bad perf for this fucntion and would impact other reader.
the logic here first scans all job ids -> then performs another full-table LIKE query for each dataset. But LIKE cannot prune job_id HASH partitions, this increases S3, network and would make other readers slow.
Consider reading job_id once in batches and aggregate the counts locally instead.
| _print_invalid_job_id_warning(invalid_job_ids) | ||
| print( | ||
| "Warning: counts use contains-LIKE matching and may overlap; " | ||
| "concurrent queries are not a single transactional snapshot.", |
Collaborator
There was a problem hiding this comment.
use LIKE query for dataset count may lead to incorrect result. it counts any job id containing xxzz, not only those whose dataset prefix is datasetName. This warning here doesn't reoslve this issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
first find all job id then counting them