Skip to content

Commit 49b3612

Browse files
yhuaimarmbrus
authored andcommitted
[SPARK-2523] [SQL] Hadoop table scan bug fixing (fix failing Jenkins maven test)
This PR tries to resolve the broken Jenkins maven test issue introduced by #1439. Now, we create a single query test to run both the setup work and the test query. Author: Yin Huai <[email protected]> Closes #1669 from yhuai/SPARK-2523-fixTest and squashes the following commits: 358af1a [Yin Huai] Make partition_based_table_scan_with_different_serde run atomically.
1 parent dc0865b commit 49b3612

6 files changed

+19
-26
lines changed

sql/hive/src/test/resources/golden/partition_based_table_scan_with_different_serde-0-1436cccda63b78dd6e43a399da6cc474

Whitespace-only changes.

sql/hive/src/test/resources/golden/partition_based_table_scan_with_different_serde-1-8d9bf54373f45bc35f8cb6e82771b154

Whitespace-only changes.

sql/hive/src/test/resources/golden/partition_based_table_scan_with_different_serde-2-7816c17905012cf381abf93d230faa8d

Whitespace-only changes.

sql/hive/src/test/resources/golden/partition_based_table_scan_with_different_serde-3-90089a6db3c3d8ee5ff5ea6b9153b3cc

Whitespace-only changes.

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,25 @@
1717

1818
package org.apache.spark.sql.hive.execution
1919

20-
import org.scalatest.{BeforeAndAfterAll, FunSuite}
21-
22-
import org.apache.spark.{SparkConf, SparkContext}
23-
import org.apache.spark.sql.hive.test.TestHive
24-
2520
class HiveTableScanSuite extends HiveComparisonTest {
26-
// MINOR HACK: You must run a query before calling reset the first time.
27-
TestHive.hql("SHOW TABLES")
28-
TestHive.reset()
29-
30-
TestHive.hql("""CREATE TABLE part_scan_test (key STRING, value STRING) PARTITIONED BY (ds STRING)
31-
| ROW FORMAT SERDE
32-
| 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe'
33-
| STORED AS RCFILE
34-
""".stripMargin)
35-
TestHive.hql("""FROM src
36-
| INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-01')
37-
| SELECT 100,100 LIMIT 1
38-
""".stripMargin)
39-
TestHive.hql("""ALTER TABLE part_scan_test SET SERDE
40-
| 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
41-
""".stripMargin)
42-
TestHive.hql("""FROM src INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-02')
43-
| SELECT 200,200 LIMIT 1
44-
""".stripMargin)
4521

46-
createQueryTest("partition_based_table_scan_with_different_serde",
47-
"SELECT * from part_scan_test", false)
22+
createQueryTest("partition_based_table_scan_with_different_serde",
23+
"""
24+
|CREATE TABLE part_scan_test (key STRING, value STRING) PARTITIONED BY (ds STRING)
25+
|ROW FORMAT SERDE
26+
|'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe'
27+
|STORED AS RCFILE;
28+
|
29+
|FROM src
30+
|INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-01')
31+
|SELECT 100,100 LIMIT 1;
32+
|
33+
|ALTER TABLE part_scan_test SET SERDE
34+
|'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe';
35+
|
36+
|FROM src INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-02')
37+
|SELECT 200,200 LIMIT 1;
38+
|
39+
|SELECT * from part_scan_test;
40+
""".stripMargin)
4841
}

0 commit comments

Comments
 (0)