Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/12412#discussion_r60347738
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
---
@@ -935,6 +935,104 @@ class HiveQuerySuite extends HiveComparisonTest with
BeforeAndAfter {
sql("DROP TABLE t1")
}
+ test("LOAD DATA") {
+ sql(
+ """
+ |CREATE EXTERNAL TABLE non_part_table (time TIMESTAMP, id INT)
+ |ROW FORMAT DELIMITED
+ |FIELDS TERMINATED BY ','
+ |LINES TERMINATED BY '\n'
+ """.stripMargin)
+
+ val testData =
TestHive.getHiveFile("data/files/issue-4077-data.txt").getCanonicalPath
+
+ // LOAD DATA INTO non-partitioned table can't specify partition
+ intercept[AnalysisException] {
+ sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE non_part_table
PARTITION(ds="1")""")
+ }
+
+ sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE
non_part_table""")
+ assert(sql("SELECT time FROM non_part_table LIMIT 2").collect()
--- End diff --
Or put it to hive `SQLQuerySuite`?
---
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]