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

[scio-core](feature) Add readFiles and readFilesWithPath apis #5350

Merged
merged 9 commits into from
May 17, 2024

Conversation

RustedBones
Copy link
Contributor

@RustedBones RustedBones commented Apr 30, 2024

  • Add new readFiles api based on splittable FileBasedSource

  • Add new readFilesWithPath propagating source file path along with element emitted by the source

  • rename readFiles to readTextFiles for lines api

  • add readAvroGenericFiles and readAvroSpecificFiles apis + WithPath api variants

@RustedBones RustedBones requested a review from kellen April 30, 2024 13:19
Comment on lines +1444 to +1446
desiredBundleSizeBytes: Long,
directoryTreatment: DirectoryTreatment,
compression: Compression
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cannot give default since we have overload.

* @param compression
* Reads files using the given [[org.apache.beam.sdk.io.Compression]].
*/
def readFilesWithPath[A: Coder](
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to provide variants for this API for the various IO types to alleviate the user burden of knowing about the underlying beam api and needing to construct the various sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to Text and Avro.

I think we should also add the readFiles variant for other file IOs.

Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 53.22581% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 61.05%. Comparing base (6ebf9c4) to head (a6b28f1).
Report is 48 commits behind head on main.

Files Patch % Lines
...spotify/scio/values/FileSCollectionFunctions.scala 61.29% 12 Missing ⚠️
...m/spotify/scio/avro/syntax/SCollectionSyntax.scala 47.61% 11 Missing ⚠️
...in/scala/com/spotify/scio/values/SCollection.scala 40.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5350      +/-   ##
==========================================
- Coverage   62.69%   61.05%   -1.64%     
==========================================
  Files         301      303       +2     
  Lines       10848    10901      +53     
  Branches      773      737      -36     
==========================================
- Hits         6801     6656     -145     
- Misses       4047     4245     +198     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RustedBones RustedBones merged commit db08aac into main May 17, 2024
11 checks passed
@RustedBones RustedBones deleted the file-api branch May 17, 2024 07:31
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.

None yet

2 participants