You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2014/08/12 05:11:33 UTC
git commit: [SQL] A tiny refactoring in HiveContext#analyze
Repository: spark
Updated Branches:
refs/heads/master e83fdcd42 -> 647aeba3a
[SQL] A tiny refactoring in HiveContext#analyze
I should use `EliminateAnalysisOperators` in `analyze` instead of manually pattern matching.
Author: Yin Huai <hu...@gmail.com>
Closes #1881 from yhuai/useEliminateAnalysisOperators and squashes the following commits:
f3e1e7f [Yin Huai] Use EliminateAnalysisOperators.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/647aeba3
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/647aeba3
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/647aeba3
Branch: refs/heads/master
Commit: 647aeba3a9e101d35083f7c4afbcfe7a33f7fc62
Parents: e83fdcd
Author: Yin Huai <hu...@gmail.com>
Authored: Mon Aug 11 20:11:29 2014 -0700
Committer: Michael Armbrust <mi...@databricks.com>
Committed: Mon Aug 11 20:11:29 2014 -0700
----------------------------------------------------------------------
.../main/scala/org/apache/spark/sql/hive/HiveContext.scala | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/647aeba3/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
----------------------------------------------------------------------
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
index 53f3dc1..a8da676 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
@@ -39,7 +39,8 @@ import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.ScalaReflection
-import org.apache.spark.sql.catalyst.analysis.{OverrideFunctionRegistry, Analyzer, OverrideCatalog}
+import org.apache.spark.sql.catalyst.analysis.{Analyzer, EliminateAnalysisOperators}
+import org.apache.spark.sql.catalyst.analysis.{OverrideCatalog, OverrideFunctionRegistry}
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.execution.ExtractPythonUdfs
import org.apache.spark.sql.execution.QueryExecutionException
@@ -119,10 +120,7 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
* in the Hive metastore.
*/
def analyze(tableName: String) {
- val relation = catalog.lookupRelation(None, tableName) match {
- case LowerCaseSchema(r) => r
- case o => o
- }
+ val relation = EliminateAnalysisOperators(catalog.lookupRelation(None, tableName))
relation match {
case relation: MetastoreRelation => {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org