Review Board 1.7.22


For partitioned table , if where statement is 'const string equals const string', the query will throw MismatchedTokenException

Review Request #10334 - Created April 8, 2013 and updated

fangkun cao
hive-trunk
HIVE-4307
Reviewers
hive
hive
https://issues.apache.org/jira/browse/HIVE-4307

 
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java
Revision 1465536 New Change
[20] 51 lines
[+20]
52
import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
52
import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
53
import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
53
import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
54
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
54
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
55
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd;
55
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd;
56
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPOr;
56
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPOr;

    
   
57
import org.apache.hadoop.hive.serde.serdeConstants;
57
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
58
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
58
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
59
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
59
import org.apache.thrift.TException;
60
import org.apache.thrift.TException;
60

    
   
61

   
61
/**
62
/**
[+20] [20] 200 lines
[+20] [+] static private ExprNodeDesc compactExpr(ExprNodeDesc expr) {
262
          return null;
263
          return null;
263
        } else if (children.get(0) == null) {
264
        } else if (children.get(0) == null) {
264
          return children.get(1);
265
          return children.get(1);
265
        } else if (children.get(1) == null) {
266
        } else if (children.get(1) == null) {
266
          return children.get(0);
267
          return children.get(0);

    
   
268
        } else if (children.get(0).getTypeString().equals(serdeConstants.STRING_TYPE_NAME) &&

    
   
269
            children.get(1).getTypeString().equals(serdeConstants.STRING_TYPE_NAME)) {

    
   
270
          return null;
267
        }
271
        }
268
      }
272
      }
269
      return expr;
273
      return expr;
270
    }
274
    }
271
    return expr;
275
    return expr;
[+20] [20] 128 lines
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/const_filter.q
New File
 
  1. http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java: Loading...
  2. http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/const_filter.q: Loading...