Abolfazl karimian
08/02/2023, 10:28 AMConfiguration conf = new Configuration();
TableClient myTableClient = DefaultTableClient.create(conf);
Table myTable = Table.forPath("Table/Path");
Snapshot mySnapshot = myTable.getLatestSnapshot(myTableClient);
Scan myScan = mySnapshot.getScanBuilder(myTableClient).build();
Row state = myScan.getScanState(myTableClient);
CloseableIterator<ColumnarBatch> FilesBatchIter = myScan.getScanFiles(myTableClient);
Optional<Expression> exp = Optional.empty();
this is the configuration that seems right.(I dont know about Optional<Expression>)
Not i want to use them to fetch data from table
while (FilesBatchIter.hasNext()) {
CloseableIterator<Row> files = FilesBatchIter.next().getRows();
CloseableIterator<DataReadResult> dataResult = Scan.readData(myTableClient, state, files, exp);
// prints the file names
while (files.hasNext()) {
Row file = files.next();
String column1Value = file.getString(0);
System.out.println(column1Value);
}
// Checking if any result is fetched by Scan.readData
while (dataResult.hasNext()) {
System.out.println("Data Found!");
}
}
It will prints file names but it seems there would be nothing in dataResult.
Any Ideas? or any sample code?venki
08/04/2023, 3:48 PMAbolfazl karimian
08/05/2023, 8:50 AMException in thread "main" java.lang.UnsupportedOperationException: timestamp is not supported
at io.delta.kernel.parquet.ParquetConverters. createConverter(ParquetConverters.java:111)
at io.delta.kernel.parquet.RowConverter.<init>(RowConverter.java:78)
...
Is there a solution for it?venki
08/06/2023, 9:37 PM