Skip to content

Commit

Permalink
add joinimpl
Browse files Browse the repository at this point in the history
  • Loading branch information
hantmac committed Aug 19, 2024
1 parent 220f8fa commit 835471a
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import io.trino.plugin.jdbc.LongWriteFunction;
import io.trino.plugin.jdbc.ObjectWriteFunction;
import io.trino.plugin.jdbc.PredicatePushdownController;
import io.trino.plugin.jdbc.PreparedQuery;
import io.trino.plugin.jdbc.QueryBuilder;
import io.trino.plugin.jdbc.RemoteTableName;
import io.trino.plugin.jdbc.StandardColumnMappings;
Expand All @@ -60,6 +61,8 @@
import io.trino.spi.connector.ColumnMetadata;
import io.trino.spi.connector.ConnectorSession;
import io.trino.spi.connector.ConnectorTableMetadata;
import io.trino.spi.connector.JoinStatistics;
import io.trino.spi.connector.JoinType;
import io.trino.spi.predicate.Domain;
import io.trino.spi.type.CharType;
import io.trino.spi.type.DecimalType;
Expand Down Expand Up @@ -112,6 +115,7 @@
import static io.trino.plugin.jdbc.DecimalSessionSessionProperties.getDecimalRounding;
import static io.trino.plugin.jdbc.DecimalSessionSessionProperties.getDecimalRoundingMode;
import static io.trino.plugin.jdbc.JdbcErrorCode.JDBC_ERROR;
import static io.trino.plugin.jdbc.JdbcJoinPushdownUtil.implementJoinCostAware;
import static io.trino.plugin.jdbc.JdbcMetadataSessionProperties.getDomainCompactionThreshold;
import static io.trino.plugin.jdbc.PredicatePushdownController.DISABLE_PUSHDOWN;
import static io.trino.plugin.jdbc.PredicatePushdownController.FULL_PUSHDOWN;
Expand Down Expand Up @@ -260,6 +264,29 @@ public boolean isTopNGuaranteed(ConnectorSession session)
return true;
}

@Override
public Optional<PreparedQuery> implementJoin(
ConnectorSession session,
JoinType joinType,
PreparedQuery leftSource,
Map<JdbcColumnHandle, String> leftProjections,
PreparedQuery rightSource,
Map<JdbcColumnHandle, String> rightProjections,
List<ParameterizedExpression> joinConditions,
JoinStatistics statistics)
{
if (joinType == JoinType.FULL_OUTER) {
return Optional.empty();
}
return implementJoinCostAware(
session,
joinType,
leftSource,
rightSource,
statistics,
() -> super.implementJoin(session, joinType, leftSource, leftProjections, rightSource, rightProjections, joinConditions, statistics));
}

@Override
public ResultSet getTables(Connection connection, Optional<String> schemaName, Optional<String> tableName)
throws SQLException
Expand Down

0 comments on commit 835471a

Please sign in to comment.