aboutsummaryrefslogtreecommitdiff
path: root/sql/hive
diff options
context:
space:
mode:
authorHerman van Hovell <hvanhovell@databricks.com>2017-02-23 10:25:18 -0800
committerWenchen Fan <wenchen@databricks.com>2017-02-23 10:25:18 -0800
commit78eae7e67fd5dec0c2d5b18000053ce86cd0f1ae (patch)
treece66255c5a02be3f56c4ced787d960198e0b1f0f /sql/hive
parent93aa4271596a30752dc5234d869c3ae2f6e8e723 (diff)
downloadspark-78eae7e67fd5dec0c2d5b18000053ce86cd0f1ae.tar.gz
spark-78eae7e67fd5dec0c2d5b18000053ce86cd0f1ae.tar.bz2
spark-78eae7e67fd5dec0c2d5b18000053ce86cd0f1ae.zip
[SPARK-19459] Support for nested char/varchar fields in ORC
## What changes were proposed in this pull request? This PR is a small follow-up on https://github.com/apache/spark/pull/16804. This PR also adds support for nested char/varchar fields in orc. ## How was this patch tested? I have added a regression test to the OrcSourceSuite. Author: Herman van Hovell <hvanhovell@databricks.com> Closes #17030 from hvanhovell/SPARK-19459-follow-up.
Diffstat (limited to 'sql/hive')
-rw-r--r--sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala
index 59ea8916ef..11dda5425c 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala
@@ -162,13 +162,16 @@ abstract class OrcSuite extends QueryTest with TestHiveSingleton with BeforeAndA
|CREATE EXTERNAL TABLE hive_orc(
| a STRING,
| b CHAR(10),
- | c VARCHAR(10))
+ | c VARCHAR(10),
+ | d ARRAY<CHAR(3)>)
|STORED AS orc""".stripMargin)
// Hive throws an exception if I assign the location in the create table statement.
hiveClient.runSqlHive(
s"ALTER TABLE hive_orc SET LOCATION '$uri'")
hiveClient.runSqlHive(
- "INSERT INTO TABLE hive_orc SELECT 'a', 'b', 'c' FROM (SELECT 1) t")
+ """INSERT INTO TABLE hive_orc
+ |SELECT 'a', 'b', 'c', ARRAY(CAST('d' AS CHAR(3)))
+ |FROM (SELECT 1) t""".stripMargin)
// We create a different table in Spark using the same schema which points to
// the same location.
@@ -177,10 +180,11 @@ abstract class OrcSuite extends QueryTest with TestHiveSingleton with BeforeAndA
|CREATE EXTERNAL TABLE spark_orc(
| a STRING,
| b CHAR(10),
- | c VARCHAR(10))
+ | c VARCHAR(10),
+ | d ARRAY<CHAR(3)>)
|STORED AS orc
|LOCATION '$uri'""".stripMargin)
- val result = Row("a", "b ", "c")
+ val result = Row("a", "b ", "c", Seq("d "))
checkAnswer(spark.table("hive_orc"), result)
checkAnswer(spark.table("spark_orc"), result)
} finally {