use of org.apache.iceberg.DistributionMode in project iceberg by apache.
the class TestSparkDistributionAndOrderingUtil method checkCopyOnWriteDistributionAndOrdering.
private void checkCopyOnWriteDistributionAndOrdering(Table table, Command command, Distribution expectedDistribution, SortOrder[] expectedOrdering) {
SparkWriteConf writeConf = new SparkWriteConf(spark, table, ImmutableMap.of());
DistributionMode mode = copyOnWriteDistributionMode(command, writeConf);
Distribution distribution = SparkDistributionAndOrderingUtil.buildCopyOnWriteDistribution(table, command, mode);
Assert.assertEquals("Distribution must match", expectedDistribution, distribution);
SortOrder[] ordering = SparkDistributionAndOrderingUtil.buildCopyOnWriteOrdering(table, command, distribution);
Assert.assertArrayEquals("Ordering must match", expectedOrdering, ordering);
}
use of org.apache.iceberg.DistributionMode in project iceberg by apache.
the class TestSparkDistributionAndOrderingUtil method checkWriteDistributionAndOrdering.
private void checkWriteDistributionAndOrdering(Table table, Distribution expectedDistribution, SortOrder[] expectedOrdering) {
SparkWriteConf writeConf = new SparkWriteConf(spark, table, ImmutableMap.of());
DistributionMode distributionMode = writeConf.distributionMode();
Distribution distribution = SparkDistributionAndOrderingUtil.buildRequiredDistribution(table, distributionMode);
Assert.assertEquals("Distribution must match", expectedDistribution, distribution);
SortOrder[] ordering = SparkDistributionAndOrderingUtil.buildRequiredOrdering(table, distribution);
Assert.assertArrayEquals("Ordering must match", expectedOrdering, ordering);
}
use of org.apache.iceberg.DistributionMode in project iceberg by apache.
the class TestSparkDistributionAndOrderingUtil method checkPositionDeltaDistributionAndOrdering.
private void checkPositionDeltaDistributionAndOrdering(Table table, Command command, Distribution expectedDistribution, SortOrder[] expectedOrdering) {
SparkWriteConf writeConf = new SparkWriteConf(spark, table, ImmutableMap.of());
DistributionMode mode = positionDeltaDistributionMode(command, writeConf);
Distribution distribution = SparkDistributionAndOrderingUtil.buildPositionDeltaDistribution(table, command, mode);
Assert.assertEquals("Distribution must match", expectedDistribution, distribution);
SortOrder[] ordering = SparkDistributionAndOrderingUtil.buildPositionDeltaOrdering(table, command);
Assert.assertArrayEquals("Ordering must match", expectedOrdering, ordering);
}
Aggregations