spark-instrumented-optimizer/sql/hive
Cheng Hao 418ad83fe1 [SPARK-3911] [SQL] HiveSimpleUdf can not be optimized in constant folding
```
explain extended select cos(null) from src limit 1;
```
outputs:
```
 Project [HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFCos(null) AS c_0#5]
  MetastoreRelation default, src, None

== Optimized Logical Plan ==
Limit 1
 Project [HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFCos(null) AS c_0#5]
  MetastoreRelation default, src, None

== Physical Plan ==
Limit 1
 Project [HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFCos(null) AS c_0#5]
  HiveTableScan [], (MetastoreRelation default, src, None), None
```
After patching this PR it outputs
```
== Parsed Logical Plan ==
Limit 1
 Project ['cos(null) AS c_0#0]
  UnresolvedRelation None, src, None

== Analyzed Logical Plan ==
Limit 1
 Project [HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFCos(null) AS c_0#0]
  MetastoreRelation default, src, None

== Optimized Logical Plan ==
Limit 1
 Project [null AS c_0#0]
  MetastoreRelation default, src, None

== Physical Plan ==
Limit 1
 Project [null AS c_0#0]
  HiveTableScan [], (MetastoreRelation default, src, None), None
```

Author: Cheng Hao <hao.cheng@intel.com>

Closes #2771 from chenghao-intel/hive_udf_constant_folding and squashes the following commits:

1379c73 [Cheng Hao] duplicate the PlanTest with catalyst/plans/PlanTest
1e52dda [Cheng Hao] add unit test for hive simple udf constant folding
01609ff [Cheng Hao] support constant folding for HiveSimpleUdf
2014-10-27 20:42:05 -07:00
..
compatibility/src/test/scala/org/apache/spark/sql/hive/execution [SQL] Update Hive test harness for Hive 12 and 13 2014-10-24 18:36:35 -07:00
src [SPARK-3911] [SQL] HiveSimpleUdf can not be optimized in constant folding 2014-10-27 20:42:05 -07:00
v0.12.0/src/main/scala/org/apache/spark/sql/hive [SQL] Update Hive test harness for Hive 12 and 13 2014-10-24 18:36:35 -07:00
v0.13.1/src/main/scala/org/apache/spark/sql/hive [SQL] Update Hive test harness for Hive 12 and 13 2014-10-24 18:36:35 -07:00
pom.xml [SPARK-2706][SQL] Enable Spark to support Hive 0.13 2014-10-24 11:03:17 -07:00