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

Support projections in ParquetAvroFileOperations/ParquetAvroSortedBucketIO #5082

Open
clairemcginty opened this issue Nov 17, 2023 · 1 comment

Comments

@clairemcginty
Copy link
Contributor

clairemcginty commented Nov 17, 2023

ParquetAvroFileOperations always overrides the "projection" option to equal the full reflected schema, so you can't supply a projection for a SpecificRecord class:

AvroReadSupport.setAvroReadSchema(configuration, schema);
AvroReadSupport.setRequestedProjection(configuration, schema);

@clairemcginty
Copy link
Contributor Author

#5083 provides a workaround for this via the Configuration parameter:

val projection: Schema = ...
val configuration = ParquetConfiguration.empty()
AvroReadSupport.setRequestedProjection(configuration, projection)

val read = ParquetAvroSortedBucketIO
  .read(tupleTag, classOf[TestRecord])
  .from(...)
  .withConfiguration(configuration)

In 0.14 we can add projection as a Builder method to ParquetAvroSortedBucketIO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants