Skip to content

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
Copy link
Author

ghost commented Jun 26, 2019

R: @akedin

@ghost
Copy link
Author

ghost commented Jun 26, 2019

Run Java_Examples_Dataflow PreCommit

1 similar comment
@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
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

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