Fix broken "Show cubes" functionality when associated table was not found.
This commit is contained in:
parent
714d380da3
commit
03d807338f
|
|
@ -291,8 +291,11 @@ final class ShowQueriesRewrite
|
|||
QualifiedObjectName qualifiedTableName = QualifiedObjectName.valueOf(cubeMetadata.getSourceTableName());
|
||||
Map<QualifiedObjectName, Long> tableLastModifiedTimeMap = new HashMap<>();
|
||||
long tableLastModifiedTime = tableLastModifiedTimeMap.computeIfAbsent(qualifiedTableName, ignored -> {
|
||||
TableHandle tableHandle = metadata.getTableHandle(session, qualifiedTableName).get();
|
||||
LongSupplier lastModifiedTimeSupplier = metadata.getTableLastModifiedTimeSupplier(session, tableHandle);
|
||||
Optional<TableHandle> tableHandle = metadata.getTableHandle(session, qualifiedTableName);
|
||||
if (!tableHandle.isPresent()) {
|
||||
return -1L;
|
||||
}
|
||||
LongSupplier lastModifiedTimeSupplier = metadata.getTableLastModifiedTimeSupplier(session, tableHandle.get());
|
||||
return lastModifiedTimeSupplier == null ? -1L : lastModifiedTimeSupplier.getAsLong();
|
||||
});
|
||||
CubeStatus status = cubeMetadata.getCubeStatus();
|
||||
|
|
|
|||
|
|
@ -650,6 +650,7 @@ public abstract class AbstractTestStarTreeQueries
|
|||
computeActual("CREATE CUBE orders_cube_predicate_unsupported_predicate ON orders_table_predicate_unsupported_predicate WITH (AGGREGATIONS=(sum(totalprice)), GROUP=(custkey, orderdate))");
|
||||
assertQueryFails("INSERT INTO CUBE orders_cube_predicate_unsupported_predicate WHERE orderdate = date '1992-01-01' OR custkey = 100", ".*Cannot support predicate.*");
|
||||
assertQueryFails("INSERT OVERWRITE CUBE orders_cube_predicate_unsupported_predicate WHERE orderdate = date '1992-01-01' OR custkey = 100", ".*Cannot support predicate.*");
|
||||
assertQueryFails("INSERT INTO CUBE orders_cube_predicate_unsupported_predicate WHERE orderdate", ".*WHERE clause must evaluate to a boolean:.*");
|
||||
assertUpdate("DROP TABLE orders_table_predicate_unsupported_predicate");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue