Github user tejasapatil commented on a diff in the pull request:
https://github.com/apache/spark/pull/11891#discussion_r57239903
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcQuerySuite.scala ---
@@ -400,4 +400,33 @@ class OrcQuerySuite extends QueryTest with
BeforeAndAfterAll with OrcTest {
}
}
}
+
+ test("SPARK-14070 Use ORC data source for SQL queries on ORC tables") {
+ withTempPath { dir =>
+ withSQLConf(SQLConf.ORC_FILTER_PUSHDOWN_ENABLED.key -> "true") {
+ val path = dir.getCanonicalPath
+
+ withTable("dummy_orc") {
+ withTempTable("single") {
+ sqlContext.sql(
+ s"""CREATE TABLE dummy_orc(key INT, value STRING)
+ |STORED AS ORC
+ |LOCATION '$path'
+ """.stripMargin)
+
+ val singleRowDF = Seq((0, "foo")).toDF("key",
"value").coalesce(1)
+ singleRowDF.registerTempTable("single")
+
+ sqlContext.sql(
+ s"""INSERT INTO TABLE dummy_orc
+ |SELECT key, value FROM single
+ """.stripMargin).collect()
+
+ val df = sqlContext.sql("SELECT * FROM dummy_orc WHERE key=0")
+ checkAnswer(df, singleRowDF)
+ }
+ }
+ }
+ }
+ }
--- End diff --
@liancheng : You are right. I had verified the plan generated by looking at
it but was not able to capture the plan as a string and compare against
expected one. On other hand, I felt that it will be a bad idea given that other
changes to the system might have the expected plan changing which will make the
test case cause of annoyance for dev.
Any advice ?
---
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]