From 45d40d9f66c666eec6df926db23937589d67225d Mon Sep 17 00:00:00 2001 From: petermaxlee Date: Sat, 20 Aug 2016 13:19:38 +0800 Subject: [SPARK-17150][SQL] Support SQL generation for inline tables ## What changes were proposed in this pull request? This patch adds support for SQL generation for inline tables. With this, it would be possible to create a view that depends on inline tables. ## How was this patch tested? Added a test case in LogicalPlanToSQLSuite. Author: petermaxlee Closes #14709 from petermaxlee/SPARK-17150. --- sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/core') diff --git a/sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala b/sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala index 0f51aa58d6..af1de511da 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala @@ -205,6 +205,9 @@ class SQLBuilder private ( case p: ScriptTransformation => scriptTransformationToSQL(p) + case p: LocalRelation => + p.toSQL(newSubqueryName()) + case OneRowRelation => "" -- cgit v1.2.3