Skip to content

Commit

Permalink
[SPARK-2523] [SQL] Hadoop table scan bug fixing (fix failing Jenkins …
Browse files Browse the repository at this point in the history
…maven test)

This PR tries to resolve the broken Jenkins maven test issue introduced by apache#1439. Now, we create a single query test to run both the setup work and the test query.

Author: Yin Huai <huai@cse.ohio-state.edu>

Closes apache#1669 from yhuai/SPARK-2523-fixTest and squashes the following commits:

358af1a [Yin Huai] Make partition_based_table_scan_with_different_serde run atomically.
  • Loading branch information
yhuai authored and conviva-zz committed Sep 4, 2014
1 parent 3419cae commit 1e6576e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,25 @@

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

import org.scalatest.{BeforeAndAfterAll, FunSuite}

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.hive.test.TestHive

class HiveTableScanSuite extends HiveComparisonTest {
// MINOR HACK: You must run a query before calling reset the first time.
TestHive.hql("SHOW TABLES")
TestHive.reset()

TestHive.hql("""CREATE TABLE part_scan_test (key STRING, value STRING) PARTITIONED BY (ds STRING)
| ROW FORMAT SERDE
| 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe'
| STORED AS RCFILE
""".stripMargin)
TestHive.hql("""FROM src
| INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-01')
| SELECT 100,100 LIMIT 1
""".stripMargin)
TestHive.hql("""ALTER TABLE part_scan_test SET SERDE
| 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
""".stripMargin)
TestHive.hql("""FROM src INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-02')
| SELECT 200,200 LIMIT 1
""".stripMargin)

createQueryTest("partition_based_table_scan_with_different_serde",
"SELECT * from part_scan_test", false)
createQueryTest("partition_based_table_scan_with_different_serde",
"""
|CREATE TABLE part_scan_test (key STRING, value STRING) PARTITIONED BY (ds STRING)
|ROW FORMAT SERDE
|'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe'
|STORED AS RCFILE;
|
|FROM src
|INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-01')
|SELECT 100,100 LIMIT 1;
|
|ALTER TABLE part_scan_test SET SERDE
|'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe';
|
|FROM src INSERT INTO TABLE part_scan_test PARTITION (ds='2010-01-02')
|SELECT 200,200 LIMIT 1;
|
|SELECT * from part_scan_test;
""".stripMargin)
}

0 comments on commit 1e6576e

Please sign in to comment.