Search in sources :

Example 1 with RemoteTableName

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;
}
Also used : JdbcNamedRelationHandle(io.trino.plugin.jdbc.JdbcNamedRelationHandle) JdbcTableHandle(io.trino.plugin.jdbc.JdbcTableHandle) RemoteTableName(io.trino.plugin.jdbc.RemoteTableName)

Aggregations

JdbcNamedRelationHandle (io.trino.plugin.jdbc.JdbcNamedRelationHandle)1 JdbcTableHandle (io.trino.plugin.jdbc.JdbcTableHandle)1 RemoteTableName (io.trino.plugin.jdbc.RemoteTableName)1