Search in sources :

Example 11 with ExpressionTree

use of org.apache.hadoop.hive.metastore.parser.ExpressionTree in project hive by apache.

the class HBaseStore method getPartitionsByFilter.

@Override
public List<Partition> getPartitionsByFilter(String dbName, String tblName, String filter, short maxParts) throws MetaException, NoSuchObjectException {
    final ExpressionTree exprTree = (filter != null && !filter.isEmpty()) ? PartFilterExprUtil.getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE;
    List<Partition> result = new ArrayList<Partition>();
    boolean commit = false;
    openTransaction();
    try {
        getPartitionsByExprInternal(HiveStringUtils.normalizeIdentifier(dbName), HiveStringUtils.normalizeIdentifier(tblName), exprTree, maxParts, result);
        return result;
    } finally {
        commitOrRoleBack(commit);
    }
}
Also used : Partition(org.apache.hadoop.hive.metastore.api.Partition) ArrayList(java.util.ArrayList) ExpressionTree(org.apache.hadoop.hive.metastore.parser.ExpressionTree)

Aggregations

ExpressionTree (org.apache.hadoop.hive.metastore.parser.ExpressionTree)11 ArrayList (java.util.ArrayList)8 Partition (org.apache.hadoop.hive.metastore.api.Partition)4 PlanResult (org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.PlanResult)4 LinkedList (java.util.LinkedList)3 FieldSchema (org.apache.hadoop.hive.metastore.api.FieldSchema)3 MultiScanPlan (org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.MultiScanPlan)3 ScanPlan (org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.ScanPlan)3 Test (org.junit.Test)3 RowFilter (org.apache.hadoop.hbase.filter.RowFilter)2 SqlFilterForPushdown (org.apache.hadoop.hive.metastore.MetaStoreDirectSql.SqlFilterForPushdown)2 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)2 List (java.util.List)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)1 Table (org.apache.hadoop.hive.metastore.api.Table)1 FilterPlan (org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.FilterPlan)1 ScanMarker (org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.ScanPlan.ScanMarker)1 MPartition (org.apache.hadoop.hive.metastore.model.MPartition)1 MStringList (org.apache.hadoop.hive.metastore.model.MStringList)1