Skip to content

Commit

Permalink
Add session property to configure ORC rowGroupMaxRowCount in Iceberg
Browse files Browse the repository at this point in the history
  • Loading branch information
craffer authored and raunaqmorarka committed Oct 22, 2024
1 parent 4d8b8d1 commit cabe3ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import static io.trino.plugin.iceberg.IcebergSessionProperties.getCompressionCodec;
import static io.trino.plugin.iceberg.IcebergSessionProperties.getOrcStringStatisticsLimit;
import static io.trino.plugin.iceberg.IcebergSessionProperties.getOrcWriterMaxDictionaryMemory;
import static io.trino.plugin.iceberg.IcebergSessionProperties.getOrcWriterMaxRowGroupRows;
import static io.trino.plugin.iceberg.IcebergSessionProperties.getOrcWriterMaxStripeRows;
import static io.trino.plugin.iceberg.IcebergSessionProperties.getOrcWriterMaxStripeSize;
import static io.trino.plugin.iceberg.IcebergSessionProperties.getOrcWriterMinStripeSize;
Expand Down Expand Up @@ -244,6 +245,7 @@ private IcebergFileWriter createOrcWriter(
.withStripeMinSize(getOrcWriterMinStripeSize(session))
.withStripeMaxSize(getOrcWriterMaxStripeSize(session))
.withStripeMaxRowCount(getOrcWriterMaxStripeRows(session))
.withRowGroupMaxRowCount(getOrcWriterMaxRowGroupRows(session))
.withDictionaryMaxMemory(getOrcWriterMaxDictionaryMemory(session))
.withMaxStringStatisticsLimit(stringStatisticsLimit),
IntStream.range(0, fileColumnNames.size()).toArray(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public final class IcebergSessionProperties
private static final String ORC_WRITER_MIN_STRIPE_SIZE = "orc_writer_min_stripe_size";
private static final String ORC_WRITER_MAX_STRIPE_SIZE = "orc_writer_max_stripe_size";
private static final String ORC_WRITER_MAX_STRIPE_ROWS = "orc_writer_max_stripe_rows";
private static final String ORC_WRITER_MAX_ROW_GROUP_ROWS = "orc_writer_max_row_group_rows";
private static final String ORC_WRITER_MAX_DICTIONARY_MEMORY = "orc_writer_max_dictionary_memory";
private static final String PARQUET_MAX_READ_BLOCK_SIZE = "parquet_max_read_block_size";
private static final String PARQUET_USE_BLOOM_FILTER = "parquet_use_bloom_filter";
Expand Down Expand Up @@ -217,6 +218,11 @@ public IcebergSessionProperties(
"ORC: Max stripe row count",
orcWriterConfig.getStripeMaxRowCount(),
false))
.add(integerProperty(
ORC_WRITER_MAX_ROW_GROUP_ROWS,
"ORC: Max number of rows in a row group",
orcWriterConfig.getRowGroupMaxRowCount(),
false))
.add(dataSizeProperty(
ORC_WRITER_MAX_DICTIONARY_MEMORY,
"ORC: Max dictionary memory",
Expand Down Expand Up @@ -472,6 +478,11 @@ public static int getOrcWriterMaxStripeRows(ConnectorSession session)
return session.getProperty(ORC_WRITER_MAX_STRIPE_ROWS, Integer.class);
}

public static int getOrcWriterMaxRowGroupRows(ConnectorSession session)
{
return session.getProperty(ORC_WRITER_MAX_ROW_GROUP_ROWS, Integer.class);
}

public static DataSize getOrcWriterMaxDictionaryMemory(ConnectorSession session)
{
return session.getProperty(ORC_WRITER_MAX_DICTIONARY_MEMORY, DataSize.class);
Expand Down

0 comments on commit cabe3ae

Please sign in to comment.