Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Jan 16, 2025
1 parent 59b467f commit 67be4a0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ public ParquetColumnResolverMap of(MessageType schema) {
*/
@Override
public ParquetColumnResolverMap of(TableKey tableKey, ParquetTableLocationKey tableLocationKey) {
final MessageType schema = tableLocationKey.getFileReader().getSchema();
// TODO: note the potential for confusion on where to derive schema from.
// final MessageType schema = tableLocationKey.getMetadata().getFileMetaData().getSchema();
return of(schema);
return of(tableLocationKey.getSchema());
}

private class FieldIdMappingVisitor implements ParquetUtil.Visitor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import io.deephaven.util.channel.SeekableChannelsProviderLoader;
import org.apache.commons.io.FilenameUtils;
import org.apache.parquet.format.RowGroup;
import org.apache.parquet.hadoop.metadata.FileMetaData;
import org.apache.parquet.hadoop.metadata.ParquetMetadata;
import org.apache.parquet.schema.MessageType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -136,8 +138,8 @@ public synchronized void setFileReader(final ParquetFileReader fileReader) {
}

/**
* Get a previously-{@link #setMetadata(ParquetMetadata) set} or on-demand created {@link ParquetMetadata} for this
* location key's {@code file}.
* Get a previously-{@link #setMetadata(ParquetMetadata) set} or the {@link ParquetMetadata} for this location key's
* {@code file}.
*
* @return A {@link ParquetMetadata} for this location key's {@code file}.
*/
Expand All @@ -159,6 +161,28 @@ public synchronized void setMetadata(final ParquetMetadata metadata) {
this.metadata = metadata;
}

/**
* Equivalent to {@code getMetadata().getFileMetaData()}.
*
* @return the file metadata
* @see #getMetadata()
* @see ParquetMetadata#getFileMetaData()
*/
public FileMetaData getFileMetadata() {
return getMetadata().getFileMetaData();
}

/**
* Equivalent to {@code getFileMetadata().getSchema()}.
*
* @return the file metadata
* @see #getFileMetadata()
* @see FileMetaData#getSchema()
*/
public MessageType getSchema() {
return getFileMetadata().getSchema();
}

/**
* Get previously-{@link #setRowGroupIndices(int[]) set} or on-demand created {@link RowGroup} indices for this
* location key's current {@link ParquetFileReader}.
Expand Down

0 comments on commit 67be4a0

Please sign in to comment.