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

lightning: a way to estimate parquet file size #46984

Merged
merged 10 commits into from
Sep 22, 2023

Conversation

zeminzhou
Copy link
Contributor

@zeminzhou zeminzhou commented Sep 14, 2023

What problem does this PR solve?

Issue Number: close #46980

Problem Summary:

What is changed and how it works?

Estimated by sampling: row data size/sampled row data size =~ row count/sampled row count.

Manual testing:
data size after conversion to row: using lightning converts the entire parquet format file to row format.
estimated data size : estimated data size by row data size/sampled row data size =~ row count/sampled row count.

source file size data size after conversion to row estimated data size size from file meta
357MB 2.02GB 2.04GB 640MB
388MB 2.19GB 2.19GB 694MB
449MB 2.52GB 2.54GB 804MB
434MB 2.43GB 2.46GB 773MB
446MB 2.49GB 2.50GB 796MB
436MB 2.43GB 2.43GB 779MB
423MB 2.39GB 2.39GB 761MB
416MB 2.35GB 2.37GB 752MB
436MB 2.43GB 2.45GB 781MB
472MB 2.64GB 2.65GB 844MB
442MB 2.47GB 2.49GB 794MB
480MB 2.69GB 2.69GB 860MB

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Sep 14, 2023
@tiprow
Copy link

tiprow bot commented Sep 14, 2023

Hi @zeminzhou. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zeminzhou
Copy link
Contributor Author

/cc lance6716

@ti-chi-bot ti-chi-bot bot requested a review from lance6716 September 14, 2023 09:34
@lance6716
Copy link
Contributor

/cc @D3Hunter

@ti-chi-bot ti-chi-bot bot requested a review from D3Hunter September 14, 2023 09:36
@okJiang
Copy link
Member

okJiang commented Sep 14, 2023

any test result for the update?

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #46984 (6585430) into master (2680a9a) will decrease coverage by 0.3275%.
Report is 10 commits behind head on master.
The diff coverage is 46.6666%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46984        +/-   ##
================================================
- Coverage   72.9964%   72.6689%   -0.3275%     
================================================
  Files          1338       1359        +21     
  Lines        399462     405795      +6333     
================================================
+ Hits         291593     294887      +3294     
- Misses        89018      92162      +3144     
+ Partials      18851      18746       -105     
Flag Coverage Δ
integration 30.8458% <0.0000%> (?)
unit 73.0036% <46.6666%> (+0.0072%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser 84.9728% <ø> (+0.0107%) ⬆️
br 48.7671% <46.6666%> (-4.3338%) ⬇️

Signed-off-by: zeminzhou <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 14, 2023
@zeminzhou
Copy link
Contributor Author

any test result for the update?

I manually tested 12 parquet files, and the errors were all within 10%.

@okJiang
Copy link
Member

okJiang commented Sep 14, 2023

any test result for the update?

I manually tested 12 parquet files, and the errors were all within 10%.

Can you post it in the description? Thank you~

br/pkg/lightning/mydump/loader.go Outdated Show resolved Hide resolved
br/pkg/lightning/mydump/loader.go Outdated Show resolved Hide resolved
br/pkg/lightning/mydump/loader.go Outdated Show resolved Hide resolved
@Benjamin2037
Copy link
Collaborator

please provide detail manual test operate steps

Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

One problem is, it will consume large time to cunstructFileInfo when inport parquet from s3.

Rest lgtm

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 18, 2023
@okJiang
Copy link
Member

okJiang commented Sep 18, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Sep 18, 2023
@lance6716
Copy link
Contributor

Hi @zeminzhou in fact parquet has recorded the "uncompressed page size" so maybe we can simply add them up.

img_v2_54bb2437-80a3-4d7c-b2e9-298629d2889g
img_v2_83e23181-f11f-4ab5-b95a-1cb488f2112g

https://parquet.incubator.apache.org/docs/file-format/metadata/

Do you have time to take a look?

@zeminzhou
Copy link
Contributor Author

Hi @zeminzhou in fact parquet has recorded the "uncompressed page size" so maybe we can simply add them up.

img_v2_54bb2437-80a3-4d7c-b2e9-298629d2889g img_v2_83e23181-f11f-4ab5-b95a-1cb488f2112g

https://parquet.incubator.apache.org/docs/file-format/metadata/

Do you have time to take a look?

I did a test and found that uncompressed page size in meta is inaccurate. Post it in the description.

Signed-off-by: zeminzhou <[email protected]>
Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

br/pkg/lightning/mydump/loader_test.go Outdated Show resolved Hide resolved
Signed-off-by: zeminzhou <[email protected]>
Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

br/pkg/lightning/mydump/loader_test.go Show resolved Hide resolved
Signed-off-by: zeminzhou <[email protected]>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, okJiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 20, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 20, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-18 10:32:20.238228609 +0000 UTC m=+513506.205816659: ☑️ agreed by okJiang.
  • 2023-09-20 09:19:08.657862958 +0000 UTC m=+681914.625450995: ☑️ agreed by lance6716.

@zeminzhou
Copy link
Contributor Author

/retest

1 similar comment
@zeminzhou
Copy link
Contributor Author

/retest

@zeminzhou
Copy link
Contributor Author

/retest

3 similar comments
@zeminzhou
Copy link
Contributor Author

/retest

@zeminzhou
Copy link
Contributor Author

/retest

@wuhuizuo
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit 398de79 into pingcap:master Sep 22, 2023
@okJiang
Copy link
Member

okJiang commented Nov 27, 2023

/cherry-pick release-7.1

@ti-chi-bot
Copy link
Member

@okJiang: new pull request created to branch release-7.1: #48908.

In response to this:

/cherry-pick release-7.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Copy link
Contributor

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lightning: a way to estimate parquet file size
8 participants