Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-2523] [SQL] Hadoop table scan bug fixing (fix failing Jenkins maven test) #1669

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}