Skip to content

Commit

Permalink
[apacheGH-3035][ParquetRewriter] removed ColumnChunkMetaData.get(path…
Browse files Browse the repository at this point in the history
…, type)
  • Loading branch information
maxim_konstantinov committed Nov 11, 2024
1 parent 1565d73 commit a5b48e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,29 +504,6 @@ public boolean hasDictionaryPage() {
public boolean isEncrypted() {
return false;
}

/**
* Copies this ColumnChunkMetaData with path and type changed to provided ones.
*
* @param path a new ColumnPath of a chunk
* @param type a new PrimitiveType of a chunk
* @return resulting chunk
*/
public ColumnChunkMetaData copy(ColumnPath path, PrimitiveType type) {
return ColumnChunkMetaData.get(
path,
type,
this.getCodec(),
this.getEncodingStats(),
this.getEncodings(),
this.getStatistics(),
this.getFirstDataPageOffset(),
this.getDictionaryPageOffset(),
this.getValueCount(),
this.getTotalSize(),
this.getTotalUncompressedSize(),
this.getSizeStatistics());
}
}

class IntColumnChunkMetaData extends ColumnChunkMetaData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public ParquetRewriter(RewriteOptions options) throws IOException {
this.newCodecName = options.getNewCodecName();
this.indexCacheStrategy = options.getIndexCacheStrategy();
this.overwriteInputWithJoinColumns = options.getOverwriteInputWithJoinColumns();
this.renamedColumns = options.gerRenameColumns();
this.renamedColumns = options.getRenameColumns();
ParquetConfiguration conf = options.getParquetConfiguration();
this.inputFiles.addAll(getFileReaders(options.getParquetInputFiles(), conf));
this.inputFilesToJoin.addAll(getFileReaders(options.getParquetInputFilesToJoin(), conf));
Expand Down Expand Up @@ -495,8 +495,19 @@ private void processBlock(

ColumnChunkMetaData chunkNormalized = chunk;
if (!renamedColumns.isEmpty()) {
chunkNormalized =
chunk.copy(normalizeFieldsInPath(chunk.getPath()), normalizeNameInType(chunk.getPrimitiveType()));
chunkNormalized = ColumnChunkMetaData.get(
normalizeFieldsInPath(chunk.getPath()),
normalizeNameInType(chunk.getPrimitiveType()),
chunk.getCodec(),
chunk.getEncodingStats(),
chunk.getEncodings(),
chunk.getStatistics(),
chunk.getFirstDataPageOffset(),
chunk.getDictionaryPageOffset(),
chunk.getValueCount(),
chunk.getTotalSize(),
chunk.getTotalUncompressedSize(),
chunk.getSizeStatistics());
}

ColumnDescriptor descriptorOriginal = outSchema.getColumns().get(outColumnIdx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public Map<String, MaskMode> getMaskColumns() {
return maskColumns;
}

public Map<String, String> gerRenameColumns() {
public Map<String, String> getRenameColumns() {
return renameColumns;
}

Expand Down

0 comments on commit a5b48e2

Please sign in to comment.