use of io.trino.plugin.jdbc.RemoteTableName in project trino by trinodb.
the class DruidJdbcClient method prepareTableHandleForQuery.
private JdbcTableHandle prepareTableHandleForQuery(JdbcTableHandle table) {
if (table.isNamedRelation()) {
String schemaName = table.getSchemaName();
checkArgument("druid".equals(schemaName), "Only \"druid\" schema is supported");
table = new JdbcTableHandle(new JdbcNamedRelationHandle(table.getRequiredNamedRelation().getSchemaTableName(), // Druid doesn't like table names to be qualified with catalog names in the SQL query, hence we null out the catalog.
new RemoteTableName(Optional.empty(), table.getRequiredNamedRelation().getRemoteTableName().getSchemaName(), table.getRequiredNamedRelation().getRemoteTableName().getTableName()), Optional.empty()), table.getConstraint(), table.getConstraintExpressions(), table.getSortOrder(), table.getLimit(), table.getColumns(), table.getOtherReferencedTables(), table.getNextSyntheticColumnId());
}
return table;
}
Aggregations