in paimon-presto-common/src/main/java/org/apache/paimon/presto/PrestoMetadata.java [137:165]
public PrestoTableHandle getTableHandle(SchemaTableName tableName, String scanVersion) {
Identifier tablePath = new Identifier(tableName.getSchemaName(), tableName.getTableName());
byte[] serializedTable;
try {
Table table = catalog.getTable(tablePath);
if (!StringUtils.isBlank(scanVersion)) {
String tableScanVersion =
PrestoPropertyUtils.getScanVersion(scanVersion, tablePath);
table =
StringUtils.isBlank(tableScanVersion)
? table
: table.copy(
new HashMap<String, String>() {
{
put(
CoreOptions.SCAN_VERSION.key(),
tableScanVersion);
}
});
}
serializedTable = InstantiationUtil.serializeObject(table);
} catch (Catalog.TableNotExistException e) {
return null;
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return new PrestoTableHandle(
tableName.getSchemaName(), tableName.getTableName(), serializedTable);
}