Skip to content
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 @@ -635,6 +635,14 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
"serde_regex",
"serde_reported_schema",
"set_variable_sub",
"show_create_table_partitioned",
"show_create_table_delimited",
"show_create_table_alter",
"show_create_table_view",
"show_create_table_serde",
"show_create_table_db_table",
"show_create_table_does_not_exist",
"show_create_table_index",
"show_describe_func_quotes",
"show_functions",
"show_partitions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private[hive] object HiveQl {
protected val nativeCommands = Seq(
"TOK_DESCFUNCTION",
"TOK_DESCDATABASE",
"TOK_SHOW_CREATETABLE",
"TOK_SHOW_TABLESTATUS",
"TOK_SHOWDATABASES",
"TOK_SHOWFUNCTIONS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ class TestHiveContext(sc: SparkContext) extends HiveContext(sc) {
set("hive.metastore.warehouse.dir", warehousePath)
}

val testTempDir = File.createTempFile("testTempFiles", "spark.hive.tmp")
testTempDir.delete()
testTempDir.mkdir()

// For some hive test case which contain ${system:test.tmp.dir}
System.setProperty("test.tmp.dir", testTempDir.getCanonicalPath)

configure() // Must be called before initializing the catalog below.

/** The location of the compiled hive distribution */
Expand Down Expand Up @@ -109,6 +116,7 @@ class TestHiveContext(sc: SparkContext) extends HiveContext(sc) {
hiveFilesTemp.mkdir()
hiveFilesTemp.deleteOnExit()


val inRepoTests = if (System.getProperty("user.dir").endsWith("sql" + File.separator + "hive")) {
new File("src" + File.separator + "test" + File.separator + "resources" + File.separator)
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE EXTERNAL TABLE tmp_showcrt1(
key smallint,
value float)
CLUSTERED BY (
key)
SORTED BY (
value DESC)
INTO 5 BUCKETS
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'transient_lastDdlTime'='1407132100')
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE TABLE tmp_showcrt1(
key smallint,
value float)
COMMENT 'temporary table'
CLUSTERED BY (
key)
SORTED BY (
value DESC)
INTO 5 BUCKETS
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'EXTERNAL'='FALSE',
'last_modified_by'='tianyi',
'last_modified_time'='1407132100',
'transient_lastDdlTime'='1407132100')
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE EXTERNAL TABLE tmp_showcrt1(
key smallint,
value float)
COMMENT 'changed comment'
CLUSTERED BY (
key)
SORTED BY (
value DESC)
INTO 5 BUCKETS
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'last_modified_by'='tianyi',
'last_modified_time'='1407132100',
'transient_lastDdlTime'='1407132100')
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE EXTERNAL TABLE tmp_showcrt1(
key smallint,
value float)
COMMENT 'changed comment'
CLUSTERED BY (
key)
SORTED BY (
value DESC)
INTO 5 BUCKETS
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'last_modified_by'='tianyi',
'last_modified_time'='1407132101',
'transient_lastDdlTime'='1407132101')
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE EXTERNAL TABLE tmp_showcrt1(
key smallint,
value float)
COMMENT 'changed comment'
CLUSTERED BY (
key)
SORTED BY (
value DESC)
INTO 5 BUCKETS
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED BY
'org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler'
WITH SERDEPROPERTIES (
'serialization.format'='1')
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'last_modified_by'='tianyi',
'last_modified_time'='1407132101',
'transient_lastDdlTime'='1407132101')
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default
tmp_feng
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE tmp_feng.tmp_showcrt(
key string,
value int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_feng.db/tmp_showcrt'
TBLPROPERTIES (
'transient_lastDdlTime'='1407132107')
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CREATE TABLE tmp_showcrt1(
key int,
value string,
newvalue bigint)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
COLLECTION ITEMS TERMINATED BY '|'
MAP KEYS TERMINATED BY '%'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/tmp_showcrt1'
TBLPROPERTIES (
'transient_lastDdlTime'='1407132730')
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE EXTERNAL TABLE tmp_showcrt1(
key string,
newvalue boolean COMMENT 'a new value')
COMMENT 'temporary table'
PARTITIONED BY (
value bigint COMMENT 'some value')
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'transient_lastDdlTime'='1407132112')
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE tmp_showcrt1(
key int,
value string,
newvalue bigint)
COMMENT 'temporary table'
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'transient_lastDdlTime'='1407132115')
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE EXTERNAL TABLE tmp_showcrt1(
key string,
value boolean)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED BY
'org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler'
WITH SERDEPROPERTIES (
'serialization.format'='$',
'field.delim'=',')
LOCATION
'file:/tmp/sparkHiveWarehouse1280221975983654134/tmp_showcrt1'
TBLPROPERTIES (
'transient_lastDdlTime'='1407132115')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE VIEW tmp_copy_src AS SELECT `src`.`key`, `src`.`value` FROM `default`.`src`
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ abstract class HiveComparisonTest
"transient_lastDdlTime",
"grantTime",
"lastUpdateTime",
"last_modified_by",
"last_modified_time",
"Owner:",
// The following are hive specific schema parameters which we do not need to match exactly.
Expand Down