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

[BEAM-7545] Adding RowCount to TextTable #8951

Merged
merged 1 commit into from
Jul 1, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jun 26, 2019

This change enables row count estimation for text table. It will first read couple of rows from the files in the directory and then using the length of those rows and the size of the files estimates the size of table.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Python Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@ghost ghost force-pushed the TextTableRowCount branch from 79b2fc9 to d622188 Compare June 26, 2019 16:43
@ghost
Copy link
Author

ghost commented Jun 26, 2019

R: @akedin

@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run Java_Examples_Dataflow PreCommit

@ghost ghost force-pushed the TextTableRowCount branch from d622188 to 9c89178 Compare June 26, 2019 17:59
@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run Java_Examples_Dataflow PreCommit

@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run JavaPortabilityApi PreCommit

@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run Java_Examples_Dataflow PreCommit

@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run JavaPortabilityApi PreCommit

@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run Java_Examples_Dataflow PreCommit

Copy link
Contributor

@akedin akedin left a comment

Choose a reason for hiding this comment

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

I think the overall approach is good, few comments:

}

FileIO.ReadableFile file =
FileIO.ReadMatches.matchToReadableFile(
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if directoryTreatment matters here, we probably can just always skip them. It might matter for actual processing but for row count estimation we have to look at the files no matter what kind directory handling we want at run time.

Copy link
Author

Choose a reason for hiding this comment

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

Yes. I have set it as a default value to SKIP. So it will just skip the directories. Do you think it is better to remove the setter for that?

return 0L;
}

return totalFileSizes * numberOfReadLines / linesSize;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment here explaining the formula?

I am also thinking whether we should add a configuration for:

  • skipping empty files from calculation;
  • choosing a different statistic, not just mean (e.g. median or any percentile);

@ghost ghost force-pushed the TextTableRowCount branch from 9c89178 to 22209df Compare June 27, 2019 21:09
@ghost
Copy link
Author

ghost commented Jun 27, 2019

Run Java_Examples_Dataflow PreCommit

@ghost
Copy link
Author

ghost commented Jun 27, 2019

Run Java PostCommit

@ghost ghost force-pushed the TextTableRowCount branch from 22209df to 16ceca5 Compare June 28, 2019 17:39
Copy link
Contributor

@akedin akedin left a comment

Choose a reason for hiding this comment

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

LGTM

@akedin akedin merged commit 3d576f7 into apache:master Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant