Skip to content

Commit

Permalink
add table file check in test case
Browse files Browse the repository at this point in the history
  • Loading branch information
guowei2 committed Jan 22, 2015
1 parent 9da56f8 commit b1ba3be
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ class SQLQuerySuite extends QueryTest {
sql("SELECT key, value FROM ctas4 ORDER BY key, value"),
sql("SELECT key, value FROM ctas4 LIMIT 1").collect().toSeq)

checkExistence(sql("DESC EXTENDED ctas2"), true,
"name:key", "type:string", "name:value", "ctas2",
"org.apache.hadoop.hive.ql.io.RCFileInputFormat",
"org.apache.hadoop.hive.ql.io.RCFileOutputFormat",
"org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe",
"serde_p1=p1", "serde_p2=p2", "tbl_p1=p11", "tbl_p2=p22","MANAGED_TABLE"
)

if (HiveShim.version =="0.13.1") {
sql(
"""CREATE TABLE ctas5
Expand All @@ -105,21 +113,22 @@ class SQLQuerySuite extends QueryTest {
| FROM src
| ORDER BY key, value""".stripMargin).collect

checkExistence(sql("DESC EXTENDED ctas5"), true,
"name:key", "type:string", "name:value", "ctas5",
"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
"MANAGED_TABLE"
)

val default = getConf("spark.sql.hive.convertMetastoreParquet", "true")
// use the Hive SerDe for parquet tables
sql("set spark.sql.hive.convertMetastoreParquet = false")
checkAnswer(
sql("SELECT key, value FROM ctas5 ORDER BY key, value"),
sql("SELECT key, value FROM src ORDER BY key, value").collect().toSeq)
sql("set spark.sql.hive.convertMetastoreParquet = true")
sql(s"set spark.sql.hive.convertMetastoreParquet = $default")
}

checkExistence(sql("DESC EXTENDED ctas2"), true,
"name:key", "type:string", "name:value", "ctas2",
"org.apache.hadoop.hive.ql.io.RCFileInputFormat",
"org.apache.hadoop.hive.ql.io.RCFileOutputFormat",
"org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe",
"serde_p1=p1", "serde_p2=p2", "tbl_p1=p11", "tbl_p2=p22","MANAGED_TABLE"
)
}

test("ordering not in select") {
Expand Down

0 comments on commit b1ba3be

Please sign in to comment.