Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/5289#discussion_r27506660
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HivePlanTest.scala
---
@@ -18,14 +18,18 @@
package org.apache.spark.sql.hive.execution
import org.apache.spark.sql.QueryTest
+import org.apache.spark.sql.catalyst.expressions.AttributeReference
+import org.apache.spark.sql.catalyst.plans.logical.LocalRelation
import org.apache.spark.sql.hive.test.TestHive
class HivePlanTest extends QueryTest {
import TestHive._
+ import TestHive.implicits._
test("udf constant folding") {
- val optimized = sql("SELECT cos(null) FROM
src").queryExecution.optimizedPlan
- val correctAnswer = sql("SELECT cast(null as double) FROM
src").queryExecution.optimizedPlan
+ Seq.empty[Tuple1[Int]].toDF("a").registerTempTable("t")
+ val optimized = sql("SELECT cos(null) FROM
t").queryExecution.optimizedPlan
+ val correctAnswer = sql("SELECT cast(null as double) FROM
t").queryExecution.optimizedPlan
--- End diff --
I'd even be okay adding a special rule to compare plans that always
replaces MetastoreRelations with LocalRelation
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]