Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.iceberg.SnapshotUpdate;
import org.apache.iceberg.Table;
import org.apache.iceberg.TableProperties;
import org.apache.iceberg.encryption.EncryptedOutputFile;
import org.apache.iceberg.expressions.Expression;
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.io.ClusteredDataWriter;
Expand Down Expand Up @@ -585,13 +584,7 @@ private static class UnpartitionedDataWriter implements DataWriter<InternalRow>

private UnpartitionedDataWriter(SparkFileWriterFactory writerFactory, OutputFileFactory fileFactory,
FileIO io, PartitionSpec spec, FileFormat format, long targetFileSize) {
// TODO: support ORC rolling writers
if (format == FileFormat.ORC) {
EncryptedOutputFile outputFile = fileFactory.newOutputFile();
delegate = writerFactory.newDataWriter(outputFile, spec, null);
} else {
delegate = new RollingDataWriter<>(writerFactory, fileFactory, io, targetFileSize, spec, null);
}
this.delegate = new RollingDataWriter<>(writerFactory, fileFactory, io, targetFileSize, spec, null);
this.io = io;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,9 @@ public void testUnpartitionedCreateWithTargetFileSizeViaTableProperties() throws
files.add(file);
}
}
// TODO: ORC file now not support target file size
if (!format.equals(FileFormat.ORC)) {
Assert.assertEquals("Should have 4 DataFiles", 4, files.size());
Assert.assertTrue("All DataFiles contain 1000 rows", files.stream().allMatch(d -> d.recordCount() == 1000));
}

Assert.assertEquals("Should have 4 DataFiles", 4, files.size());
Assert.assertTrue("All DataFiles contain 1000 rows", files.stream().allMatch(d -> d.recordCount() == 1000));
}

@Test
Expand Down Expand Up @@ -585,11 +583,9 @@ public void partitionedCreateWithTargetFileSizeViaOption(IcebergOptionsType opti
files.add(file);
}
}
// TODO: ORC file now not support target file size
if (!format.equals(FileFormat.ORC)) {
Assert.assertEquals("Should have 8 DataFiles", 8, files.size());
Assert.assertTrue("All DataFiles contain 1000 rows", files.stream().allMatch(d -> d.recordCount() == 1000));
}

Assert.assertEquals("Should have 8 DataFiles", 8, files.size());
Assert.assertTrue("All DataFiles contain 1000 rows", files.stream().allMatch(d -> d.recordCount() == 1000));
}

public enum IcebergOptionsType {
Expand Down