Skip to content

Commit

Permalink
Be sure to correctly re-map RowSet column names when writing persiste…
Browse files Browse the repository at this point in the history
…nt data indexes to Parquet.
  • Loading branch information
rcaudy committed Mar 19, 2024
1 parent a7bc940 commit c6ff002
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,15 @@ static void write(
tableInfoBuilder.addDataIndexes(DataIndexInfo.of(
destDirPath.relativize(info.metadataFilePath.toPath()).toString(),
info.parquetColumnNames));
write(indexTable, indexTable.getDefinition(), writeInstructions,
final ParquetInstructions writeInstructionsToUse;
if (INDEX_ROW_SET_COLUMN_NAME.equals(dataIndex.rowSetColumnName())) {
writeInstructionsToUse = writeInstructions;
} else {
writeInstructionsToUse = new ParquetInstructions.Builder(writeInstructions)
.addColumnNameMapping(INDEX_ROW_SET_COLUMN_NAME, dataIndex.rowSetColumnName())
.build();
}
write(indexTable, indexTable.getDefinition(), writeInstructionsToUse,
info.destFile.getAbsolutePath(), Collections.emptyMap(), TableInfo.builder());
}
}
Expand Down

0 comments on commit c6ff002

Please sign in to comment.