Package org.apache.hadoop.hive.ql.optimizer.optiq

Examples of org.apache.hadoop.hive.ql.optimizer.optiq.RelOptHiveTable


      expr = RelOptUtil.pushFilterPastProject(expr, (ProjectRelBase) r);
      return isPartitionPredicate(expr, ((ProjectRelBase) r).getChild());
    } else if (r instanceof FilterRelBase) {
      return isPartitionPredicate(expr, ((FilterRelBase) r).getChild());
    } else if (r instanceof HiveTableScanRel) {
      RelOptHiveTable table = (RelOptHiveTable) ((HiveTableScanRel) r).getTable();
      BitSet cols = RelOptUtil.InputFinder.bits(expr);
      return table.containsPartitionColumnsOnly(cols);
    }
    return false;
  }
View Full Code Here


            ASTBuilder.construct(HiveParser.TOK_DIR, "TOK_DIR").add(HiveParser.TOK_TMP_FILE,
                "TOK_TMP_FILE")).node();
  }

  static ASTNode table(TableAccessRelBase scan) {
    RelOptHiveTable hTbl = (RelOptHiveTable) scan.getTable();
    ASTBuilder b = ASTBuilder.construct(HiveParser.TOK_TABREF, "TOK_TABREF").add(
        ASTBuilder.construct(HiveParser.TOK_TABNAME, "TOK_TABNAME")
            .add(HiveParser.Identifier, hTbl.getHiveTableMD().getDbName())
            .add(HiveParser.Identifier, hTbl.getHiveTableMD().getTableName()));

    // NOTE: Optiq considers tbls to be equal if their names are the same. Hence
    // we need to provide Optiq the fully qualified table name (dbname.tblname)
    // and not the user provided aliases.
    // However in HIVE DB name can not appear in select list; in case of join
    // where table names differ only in DB name, Hive would require user
    // introducing explicit aliases for tbl.
    b.add(HiveParser.Identifier, hTbl.getTableAlias());
    return b.node();
  }
View Full Code Here

  }

  protected void perform(RelOptRuleCall call, FilterRelBase filter,
      HiveTableScanRel tScan) {

    RelOptHiveTable hiveTable = (RelOptHiveTable) tScan.getTable();
    RexNode predicate = filter.getCondition();

    Pair<RexNode, RexNode> predicates = PartitionPruner
        .extractPartitionPredicates(filter.getCluster(), hiveTable, predicate);
    RexNode partColExpr = predicates.left;
    hiveTable.computePartitionList(conf, partColExpr);
  }
View Full Code Here

        String fullyQualifiedTabName = tab.getDbName();
        if (fullyQualifiedTabName != null && !fullyQualifiedTabName.isEmpty())
          fullyQualifiedTabName = fullyQualifiedTabName + "." + tab.getTableName();
        else
          fullyQualifiedTabName = tab.getTableName();
        RelOptHiveTable optTable = new RelOptHiveTable(relOptSchema, fullyQualifiedTabName,
            tableAlias, rowType, tab, nonPartitionColumns, partitionColumns, conf, partitionCache,
            noColsMissingStats);

        // 5. Build Hive Table Scan Rel
        tableRel = new HiveTableScanRel(cluster, cluster.traitSetOf(HiveRel.CONVENTION), optTable,
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.optimizer.optiq.RelOptHiveTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.