GH-3780: Decouple ParquetReadOptions from hadoop-mapreduce-client-core - #3781
Open
jerolba wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Reading the Parquet read configuration via
ParquetReadOptionspreviously referencedParquetInputFormat.getFilter(...)and statically imported its constants.ParquetInputFormatextendsorg.apache.hadoop.mapreduce.lib.input.FileInputFormat, so using the read configuration forced the JVMto initialize
ParquetInputFormatand thereforeFileInputFormatand its wholeorg.apache.hadoop.mapreduce.*transitive dependency graph, even though only plainString/booleanconfig properties were needed. The new
ParquetInputProperties(constants) andParquetInputFilters(filter resolution) centralise the
ParquetConfiguration-based read configuration so that read-onlyconsumers no longer transitively pull in the Hadoop
mapreducedependency.What changes are included in this PR?
New files
parquet-hadoop/src/main/java/org/apache/parquet/conf/ParquetInputProperties.javaParquetInputFormat:READ_SUPPORT_CLASS,UNBOUND_RECORD_FILTER,STRICT_TYPE_CHECKING,FILTER_PREDICATE,RECORD_FILTERING_ENABLED,STATS_FILTERING_ENABLED,DICTIONARY_FILTERING_ENABLED,COLUMN_INDEX_FILTERING_ENABLED,PAGE_VERIFY_CHECKSUM_ENABLED,BLOOM_FILTERING_ENABLED,OFF_HEAP_DECRYPT_BUFFER_ENABLED,HADOOP_VECTORED_IO_ENABLED,HADOOP_VECTORED_IO_DEFAULT.org.apache.hadoop.mapreducedependency.parquet-hadoop/src/main/java/org/apache/parquet/conf/ParquetInputFilters.javaParquetConfiguration-based filter resolution:getFilter(ParquetConfiguration),getUnboundRecordFilter(ParquetConfiguration)andgetFilterPredicate(ParquetConfiguration).org.apache.hadoop.mapreducedependency.Removed
parquet-hadoop/src/main/java/org/apache/parquet/ParquetInputConfiguration.java(intermediateclass, split into the two classes above).
Modified
parquet-hadoop/.../ParquetReadOptions.javaParquetInputProperties, and thegetFilter(...)call toParquetInputFiltersinstead ofParquetInputFormat.ParquetReadOptionsno longer referencesParquetInputFormat.parquet-hadoop/.../hadoop/InternalParquetRecordReader.javaRECORD_FILTERING_ENABLED/STRICT_TYPE_CHECKINGnow fromParquetInputProperties.parquet-hadoop/.../hadoop/ParquetInputFormat.java@Deprecated, delegating toParquetInputProperties.*.Configuration-basedgetFilter(Configuration)/getUnboundRecordFilter(Configuration)overloads (used by the MapReduce read path), delegating bywrapping into
HadoopParquetConfiguration. Internal callers useParquetInputFilters/ParquetInputPropertiesdirectly.DeprecatedInputFormatTest,TestParquetFileWriter,TestInputOutputFormat,TestInputFormatColumnProjection,TestDataPageChecksums,TestColumnChunkPageWriteStore,TestPropertiesDrivenEncryption).Are these changes tested?
No change in behavior, just refactoring code location. Code compilation and existing tests validate the change.
Are there any user-facing changes?
No. Fully backward and binary compatible: the
ParquetInputFormatconstants and methods are retained(deprecated) and delegate to the new class; constant string/boolean values are unchanged, so any
previously-serialised configuration still works.
Closes #3780