Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/16804#discussion_r99938462
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala ---
@@ -162,6 +162,40 @@ abstract class OrcSuite extends QueryTest with
TestHiveSingleton with BeforeAndA
hiveClient.runSqlHive("DROP TABLE IF EXISTS orc_varchar")
}
}
+
+ test("SPARK-19459: read char/varchar column written by Hive") {
+ val hiveClient =
spark.sharedState.externalCatalog.asInstanceOf[HiveExternalCatalog].client
+ val location = Utils.createTempDir().toURI
+ try {
+ hiveClient.runSqlHive(
+ """
+ |CREATE EXTERNAL TABLE hive_orc(
+ | a STRING,
+ | b CHAR(10),
+ | c VARCHAR(10))
+ |STORED AS orc""".stripMargin)
+ // Hive throws an exception if I assign the location in the create
table statment.
+ hiveClient.runSqlHive(
+ s"ALTER TABLE hive_orc SET LOCATION '$location'")
+ hiveClient.runSqlHive(
+ "INSERT INTO TABLE hive_orc SELECT 'a', 'b', 'c' FROM (SELECT 1)
t")
+
--- End diff --
yeah that makes sense
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]