use of io.trino.orc.OrcReaderOptions in project trino by trinodb.
the class TestOriginalFilesUtils method testGetPrecedingRowCountSingleFile.
@Test
public void testGetPrecedingRowCountSingleFile() {
List<OriginalFileInfo> originalFileInfoList = new ArrayList<>();
originalFileInfoList.add(new OriginalFileInfo("000001_0", 730));
long rowCountResult = OriginalFilesUtils.getPrecedingRowCount(originalFileInfoList, new Path(tablePath + "/000001_0"), HDFS_ENVIRONMENT, SESSION.getIdentity(), new OrcReaderOptions(), config, new FileFormatDataSourceStats());
assertEquals(rowCountResult, 0, "Original file should have 0 as the starting row count");
}
use of io.trino.orc.OrcReaderOptions in project trino by trinodb.
the class TestOrcDeleteDeltaPageSource method testReadingDeletedRows.
@Test
public void testReadingDeletedRows() throws Exception {
File deleteDeltaFile = new File(Resources.getResource("fullacid_delete_delta_test/delete_delta_0000004_0000004_0000/bucket_00000").toURI());
OrcDeleteDeltaPageSourceFactory pageSourceFactory = new OrcDeleteDeltaPageSourceFactory(new OrcReaderOptions(), ConnectorIdentity.ofUser("test"), new JobConf(new Configuration(false)), HDFS_ENVIRONMENT, new FileFormatDataSourceStats());
ConnectorPageSource pageSource = pageSourceFactory.createPageSource(new Path(deleteDeltaFile.toURI()), deleteDeltaFile.length()).orElseThrow();
MaterializedResult materializedRows = MaterializedResult.materializeSourceDataStream(SESSION, pageSource, ImmutableList.of(BIGINT, INTEGER, BIGINT));
assertEquals(materializedRows.getRowCount(), 1);
AcidOutputFormat.Options bucketOptions = new AcidOutputFormat.Options(new Configuration(false)).bucket(0);
assertEquals(materializedRows.getMaterializedRows().get(0), new MaterializedRow(5, 2L, BucketCodec.V1.encode(bucketOptions), 0L));
}
Aggregations