diff options
author | Wenchen Fan <wenchen@databricks.com> | 2016-03-21 10:04:49 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-03-21 10:04:49 -0700 |
commit | a2a90780281115b72ebe2e4334d6e83058436e27 (patch) | |
tree | 8af16fbd7a37471e5631dd3f0f1c13a14a836748 | |
parent | df61fbd9787efbb80ff20927cb6b95002423d2f2 (diff) | |
download | spark-a2a90780281115b72ebe2e4334d6e83058436e27.tar.gz spark-a2a90780281115b72ebe2e4334d6e83058436e27.tar.bz2 spark-a2a90780281115b72ebe2e4334d6e83058436e27.zip |
[SPARK-14039][SQL][MINOR] make SubqueryHolder an inner class
## What changes were proposed in this pull request?
`SubqueryHolder` is only used when generate SQL string in `SQLBuilder`, it's more clear to make it an inner class in `SQLBuilder`.
## How was this patch tested?
existing tests.
Author: Wenchen Fan <wenchen@databricks.com>
Closes #11861 from cloud-fan/gensql.
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala index 5175bd4609..b2196c4409 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala @@ -34,15 +34,6 @@ import org.apache.spark.sql.hive.execution.HiveScriptIOSchema import org.apache.spark.sql.types.{ByteType, DataType, IntegerType, NullType} /** - * A place holder for generated SQL for subquery expression. - */ -case class SubqueryHolder(query: String) extends LeafExpression with Unevaluable { - override def dataType: DataType = NullType - override def nullable: Boolean = true - override def sql: String = s"($query)" -} - -/** * A builder class used to convert a resolved logical plan into a SQL query string. Note that not * all resolved logical plan are convertible. They either don't have corresponding SQL * representations (e.g. logical plans that operate on local Scala collections), or are simply not @@ -530,4 +521,13 @@ class SQLBuilder(logicalPlan: LogicalPlan, sqlContext: SQLContext) extends Loggi case _ => None } } + + /** + * A place holder for generated SQL for subquery expression. + */ + case class SubqueryHolder(query: String) extends LeafExpression with Unevaluable { + override def dataType: DataType = NullType + override def nullable: Boolean = true + override def sql: String = s"($query)" + } } |