use of org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter in project hive by apache.
the class JDBCExtractJoinFilterRule method matches.
// ~ Methods ----------------------------------------------------------------
@Override
public boolean matches(RelOptRuleCall call) {
final Join join = call.rel(0);
final HiveJdbcConverter conv1 = call.rel(1);
final HiveJdbcConverter conv2 = call.rel(2);
if (!conv1.getJdbcDialect().equals(conv2.getJdbcDialect())) {
return false;
}
return JDBCAbstractSplitFilterRule.canSplitFilter(join.getCondition(), conv1.getJdbcDialect());
}
use of org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter in project hive by apache.
the class JDBCFilterPushDownRule method matches.
@Override
public boolean matches(RelOptRuleCall call) {
final HiveFilter filter = call.rel(0);
final HiveJdbcConverter converter = call.rel(1);
RexNode cond = filter.getCondition();
return JDBCRexCallValidator.isValidJdbcOperation(cond, converter.getJdbcDialect());
}
use of org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter in project hive by apache.
the class JDBCProjectPushDownRule method matches.
@Override
public boolean matches(RelOptRuleCall call) {
final HiveProject project = call.rel(0);
final HiveJdbcConverter conv = call.rel(1);
for (RexNode currProject : project.getProjects()) {
if (!JDBCRexCallValidator.isValidJdbcOperation(currProject, conv.getJdbcDialect())) {
return false;
}
if (!validDataType(conv.getJdbcDialect(), currProject)) {
return false;
}
}
return true;
}
use of org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter in project hive by apache.
the class JDBCSortPushDownRule method onMatch.
@Override
public void onMatch(RelOptRuleCall call) {
LOG.debug("JDBCSortPushDownRule has been called");
final HiveSortLimit sort = call.rel(0);
final HiveJdbcConverter converter = call.rel(1);
RelNode node = (sort.fetch != null && RexLiteral.intValue(sort.fetch) == 0) ? new JdbcFilter(sort.getCluster(), sort.getTraitSet().replace(converter.getJdbcConvention()), converter.getInput(), call.builder().literal(false)) : new JdbcSort(sort.getCluster(), sort.getTraitSet().replace(converter.getJdbcConvention()), converter.getInput(), sort.getCollation(), sort.offset, sort.fetch);
call.transformTo(converter.copy(converter.getTraitSet(), node));
}
use of org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter in project hive by apache.
the class JDBCFilterJoinRule method matches.
@Override
public boolean matches(RelOptRuleCall call) {
Filter filter = call.rel(0);
Join join = call.rel(1);
HiveJdbcConverter conv1 = call.rel(2);
HiveJdbcConverter conv2 = call.rel(3);
if (!conv1.getJdbcDialect().equals(conv2.getJdbcDialect())) {
return false;
}
boolean visitorRes = JDBCRexCallValidator.isValidJdbcOperation(filter.getCondition(), conv1.getJdbcDialect());
if (visitorRes) {
return JDBCRexCallValidator.isValidJdbcOperation(join.getCondition(), conv1.getJdbcDialect());
}
return false;
}
Aggregations