Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data] Use sampled fragments to estimate Parquet reader batch size #45749

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

bveeramani
Copy link
Member

Why are these changes needed?

ParquetDatasource uses fetched metadata to determine the Parquet reader batch size. If the metadata provider doesn't provide metadata, ParquetDatasource uses a default value of 10,000 rows. While this value might be reasonable for tabular data, the default value can lead to poor performance or even errors if each row is large. To avoid this issue, this PR updates the implementation to use the sampled fragments to determine the batch size.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Balaji Veeramani <[email protected]>
@bveeramani bveeramani enabled auto-merge (squash) June 5, 2024 10:06
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Jun 5, 2024
@github-actions github-actions bot disabled auto-merge June 5, 2024 18:45
@bveeramani bveeramani enabled auto-merge (squash) June 5, 2024 18:57
sample_info.actual_bytes_per_row is None
or sample_info.estimated_bytes_per_row is None
):
return PARQUET_ENCODING_RATIO_ESTIMATE_LOWER_BOUND
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if some samples are None while some are not, should we drop the None values? I.E., only fallback to this lower bound if all samples are None.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I matched the behavior of the existing implementation, but that makes sense to me.

@c21 wdyt (I think you wrote the original implementation)? I can address this in a follow-up PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes make sense to me.

@bveeramani bveeramani merged commit 6031b4a into ray-project:master Jun 5, 2024
7 checks passed
Copy link
Contributor

@c21 c21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

late LGTM

@bveeramani bveeramani deleted the parquet-estimation branch June 5, 2024 22:17
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 6, 2024
…ay-project#45749)

ParquetDatasource uses fetched metadata to determine the Parquet reader batch size. If the metadata provider doesn't provide metadata, ParquetDatasource uses a default value of 10,000 rows. While this value might be reasonable for tabular data, the default value can lead to poor performance or even errors if each row is large. To avoid this issue, this PR updates the implementation to use the sampled fragments to determine the batch size.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Ryan O'Leary <[email protected]>
yucai pushed a commit to yucai/ray that referenced this pull request Jun 6, 2024
…ay-project#45749)

ParquetDatasource uses fetched metadata to determine the Parquet reader batch size. If the metadata provider doesn't provide metadata, ParquetDatasource uses a default value of 10,000 rows. While this value might be reasonable for tabular data, the default value can lead to poor performance or even errors if each row is large. To avoid this issue, this PR updates the implementation to use the sampled fragments to determine the batch size.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: yucai <[email protected]>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 6, 2024
…ay-project#45749)

ParquetDatasource uses fetched metadata to determine the Parquet reader batch size. If the metadata provider doesn't provide metadata, ParquetDatasource uses a default value of 10,000 rows. While this value might be reasonable for tabular data, the default value can lead to poor performance or even errors if each row is large. To avoid this issue, this PR updates the implementation to use the sampled fragments to determine the batch size.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Ryan O'Leary <[email protected]>
yucai pushed a commit to yucai/ray that referenced this pull request Jun 7, 2024
…ay-project#45749)

ParquetDatasource uses fetched metadata to determine the Parquet reader batch size. If the metadata provider doesn't provide metadata, ParquetDatasource uses a default value of 10,000 rows. While this value might be reasonable for tabular data, the default value can lead to poor performance or even errors if each row is large. To avoid this issue, this PR updates the implementation to use the sampled fragments to determine the batch size.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: yucai <[email protected]>
richardsliu pushed a commit to richardsliu/ray that referenced this pull request Jun 12, 2024
…ay-project#45749)

ParquetDatasource uses fetched metadata to determine the Parquet reader batch size. If the metadata provider doesn't provide metadata, ParquetDatasource uses a default value of 10,000 rows. While this value might be reasonable for tabular data, the default value can lead to poor performance or even errors if each row is large. To avoid this issue, this PR updates the implementation to use the sampled fragments to determine the batch size.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants