viirya commented on a change in pull request #23628: [SPARK-26702][SQL][TEST]
Create a test trait for Parquet and Orc test
URL: https://github.com/apache/spark/pull/23628#discussion_r251713105
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala
##########
@@ -270,10 +270,16 @@ abstract class OrcQueryTest extends OrcTest {
test("appending") {
val data = (0 until 10).map(i => (i, i.toString))
spark.createDataFrame(data).toDF("c1", "c2").createOrReplaceTempView("tmp")
- withOrcTable(data, "t") {
- sql("INSERT INTO TABLE t SELECT * FROM tmp")
- checkAnswer(spark.table("t"), (data ++ data).map(Row.fromTuple))
+
+ withOrcFile(data) { file =>
Review comment:
Previously, `withOrcTable` runs only vectorized case. After this,
`withOrcTable` runs vectorized and non-vectorized cases. Because the test
closure has side effect that modifies table `t`. So in the second run, the
table `t` is changed and can't match the expected answer.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]