Skip to content

Commit

Permalink
[Iceberg] rename "target_split_size" to "target_split_size_bytes"
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacBlanco committed Feb 26, 2025
1 parent 0927c8f commit 52112d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion presto-docs/src/main/sphinx/connector/iceberg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Property Name Description
``iceberg.rows_for_metadata_optimization_threshold`` Overrides the behavior of the connector property
``iceberg.rows-for-metadata-optimization-threshold`` in the current
session.
``iceberg.target_split_size`` Overrides the target split size for all tables in a query in bytes.
``iceberg.target_split_size_bytes`` Overrides the target split size for all tables in a query in bytes.
Set to 0 to use the value in each Iceberg table's
``read.split.target-size`` property.
``iceberg.affinity_scheduling_file_section_size`` When the ``node_selection_strategy`` or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public final class IcebergSessionProperties
public static final String STATISTIC_SNAPSHOT_RECORD_DIFFERENCE_WEIGHT = "statistic_snapshot_record_difference_weight";
public static final String ROWS_FOR_METADATA_OPTIMIZATION_THRESHOLD = "rows_for_metadata_optimization_threshold";
public static final String STATISTICS_KLL_SKETCH_K_PARAMETER = "statistics_kll_sketch_k_parameter";
public static final String TARGET_SPLIT_SIZE = "target_split_size";
public static final String TARGET_SPLIT_SIZE_BYTES = "target_split_size_bytes";

private final List<PropertyMetadata<?>> sessionProperties;

Expand Down Expand Up @@ -193,7 +193,7 @@ public IcebergSessionProperties(
icebergConfig.getStatisticsKllSketchKParameter(),
false))
.add(longProperty(
TARGET_SPLIT_SIZE,
TARGET_SPLIT_SIZE_BYTES,
"The target split size. Set to 0 to use the iceberg table's read.split.target-size property",
0L,
false));
Expand Down Expand Up @@ -333,6 +333,6 @@ public static int getStatisticsKllSketchKParameter(ConnectorSession session)

public static Long getTargetSplitSize(ConnectorSession session)
{
return session.getProperty(TARGET_SPLIT_SIZE, Long.class);
return session.getProperty(TARGET_SPLIT_SIZE_BYTES, Long.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import static com.facebook.presto.hive.HiveCommonSessionProperties.NODE_SELECTION_STRATEGY;
import static com.facebook.presto.iceberg.IcebergQueryRunner.ICEBERG_CATALOG;
import static com.facebook.presto.iceberg.IcebergSessionProperties.PUSHDOWN_FILTER_ENABLED;
import static com.facebook.presto.iceberg.IcebergSessionProperties.TARGET_SPLIT_SIZE;
import static com.facebook.presto.iceberg.IcebergSessionProperties.TARGET_SPLIT_SIZE_BYTES;
import static com.facebook.presto.spi.connector.NotPartitionedPartitionHandle.NOT_PARTITIONED;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
Expand Down Expand Up @@ -178,7 +178,7 @@ private void testGetSplitsByNonIdentityPartitionColumns(String tableName, boolea
public void testSplitSchedulingWithTablePropertyAndSession()
{
Session session = Session.builder(getSession())
.setCatalogSessionProperty("iceberg", IcebergSessionProperties.TARGET_SPLIT_SIZE, "0")
.setCatalogSessionProperty("iceberg", IcebergSessionProperties.TARGET_SPLIT_SIZE_BYTES, "0")
.build();
assertQuerySucceeds("CREATE TABLE test_split_size as SELECT * FROM UNNEST(sequence(1, 512)) as t(i)");
// verify that the session property hasn't propagated into the table
Expand All @@ -198,7 +198,7 @@ public void testSplitSchedulingWithTablePropertyAndSession()
// Set it to 1 with the session property to override the table value and verify we get the
// same number of splits as when the table value is set to 1.
Session minSplitSession = Session.builder(session)
.setCatalogSessionProperty("iceberg", TARGET_SPLIT_SIZE, "1")
.setCatalogSessionProperty("iceberg", TARGET_SPLIT_SIZE_BYTES, "1")
.build();
assertEquals(getSplitsForSql(minSplitSession, selectQuery).size(), maxSplits);
assertQuerySucceeds("DROP TABLE test_split_size");
Expand Down

0 comments on commit 52112d8

Please sign in to comment.