Description
Follow-up of HIVE-13068.
Extension to folding expressions for NOT.
Currently, simplification is performed only if NOT is applied on a simple operation (e.g. IS NOT NULL, =, <>, etc.). We should take advantage of NOT distributivity when it is applied on OR/AND operations to try to simplify predicates further.
Ex. ql/src/test/results/clientpositive/folder_predicate.q.out
explain SELECT * FROM predicate_fold_tb WHERE not(value IS NOT NULL AND value = 3)
Plan:
STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: predicate_fold_tb Statistics: Num rows: 6 Data size: 7 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (not (value is not null and (value = 3))) (type: boolean) Statistics: Num rows: 3 Data size: 3 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: value (type: int) outputColumnNames: _col0 Statistics: Num rows: 3 Data size: 3 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 3 Data size: 3 Basic stats: COMPLETE Column stats: NONE table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: ListSink
Attachments
Attachments
Issue Links
- relates to
-
HIVE-13068 Disable Hive ConstantPropagate optimizer when CBO has optimized the plan II
- Closed
+1 will likely require updates to other golden files as well.