Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/13678#discussion_r67201568
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala ---
@@ -259,4 +259,15 @@ class InsertSuite extends DataSourceTest with
SharedSQLContext {
spark.catalog.dropTempView("oneToTen")
}
+
+ test("SPARK-15824 - Execute an INSERT wrapped in a WITH statement
immediately") {
+ withTable("target") {
+ sql("CREATE TABLE target(a INT, b STRING) USING JSON")
+ sql("WITH tbl AS (SELECT 1, 'a') INSERT OVERWRITE TABLE target
SELECT a, b FROM jt")
+ checkAnswer(
+ sql("SELECT a, b FROM target"),
+ (1 to 10).map(i => Row(i, s"str$i"))
--- End diff --
nit: we can use `sql("SELECT a, b FROM jt")` here.
---
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]