Package io.deephaven.parquet.table
Class ParquetSchemaReader
java.lang.Object
io.deephaven.parquet.table.ParquetSchemaReader
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static final class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Pair<List<ColumnDefinition<?>>,
ParquetInstructions> convertSchema
(@NotNull org.apache.parquet.schema.MessageType schema, @NotNull Map<String, String> keyValueMetadata, @NotNull ParquetInstructions readInstructionsIn) Convert schema information from aParquetMetadata
intoColumnDefinitions
.parseMetadata
(@NotNull Map<String, String> keyValueMetadata) static ParquetInstructions
readParquetSchema
(@NotNull org.apache.parquet.schema.MessageType schema, @NotNull Map<String, String> keyValueMetadata, @NotNull ParquetInstructions readInstructions, @NotNull ParquetSchemaReader.ColumnDefinitionConsumer consumer, @NotNull BiFunction<String, Set<String>, String> legalizeColumnNameFunc) Obtain schema information from a parquet file
-
Constructor Details
-
ParquetSchemaReader
public ParquetSchemaReader()
-
-
Method Details
-
parseMetadata
-
readParquetSchema
public static ParquetInstructions readParquetSchema(@NotNull @NotNull org.apache.parquet.schema.MessageType schema, @NotNull @NotNull Map<String, String> keyValueMetadata, @NotNull @NotNull ParquetInstructions readInstructions, @NotNull @NotNull ParquetSchemaReader.ColumnDefinitionConsumer consumer, @NotNull @NotNull BiFunction<String, Set<String>, String> legalizeColumnNameFunc) Obtain schema information from a parquet file- Parameters:
schema
- Parquet schema. DO NOT RELY ONParquetMetadataConverter
FOR THIS! USEParquetFileReader
!keyValueMetadata
- Parquet key-value metadata mapreadInstructions
- Parquet read instructions specifying transformations like column mappings and codecs. Note a new read instructions based on this one may be returned by this method to provide necessary transformations, eg, replacing unsupported characters like ' ' (space) in column names.consumer
- A ColumnDefinitionConsumer whose accept method would be called for each column in the file- Returns:
- Parquet read instructions, either the ones supplied or a new object based on the supplied with necessary transformations added.
-
convertSchema
public static Pair<List<ColumnDefinition<?>>,ParquetInstructions> convertSchema(@NotNull @NotNull org.apache.parquet.schema.MessageType schema, @NotNull @NotNull Map<String, String> keyValueMetadata, @NotNull @NotNull ParquetInstructions readInstructionsIn) Convert schema information from aParquetMetadata
intoColumnDefinitions
.- Parameters:
schema
- Parquet schema. DO NOT RELY ONParquetMetadataConverter
FOR THIS! USEParquetFileReader
!keyValueMetadata
- Parquet key-value metadata mapreadInstructionsIn
- Input conversionParquetInstructions
- Returns:
- A
Pair
withColumnDefinitions
and adjustedParquetInstructions
-