Skip to content

Commit 58690c0

Browse files
committed
fix implemented-error
1 parent a38e23c commit 58690c0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ case class Alias(child: Expression, name: String)
121121
}
122122
}
123123

124-
override def toString: String = s"$child AS $name#${exprId.id}$typeSuffix"
124+
override def toString: String = s"$child AS $name#${exprId.id}"
125125

126126
override protected final def otherCopyArgs = exprId :: qualifiers :: Nil
127127
}

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import scala.util.Try
2727
import org.apache.hadoop.hive.conf.HiveConf.ConfVars
2828

2929
import org.apache.spark.{SparkFiles, SparkException}
30-
import org.apache.spark.sql.{DataFrame, Row}
30+
import org.apache.spark.sql.{AnalysisException, DataFrame, Row}
3131
import org.apache.spark.sql.catalyst.plans.logical.Project
3232
import org.apache.spark.sql.Dsl._
3333
import org.apache.spark.sql.hive._
@@ -575,6 +575,12 @@ class HiveQuerySuite extends HiveComparisonTest with BeforeAndAfter {
575575
}
576576
}
577577

578+
test("analyzer should not throw NotImplementedError") {
579+
intercept[AnalysisException] {
580+
sql("SELECT CAST(x AS STRING) FROM src").collect()
581+
}
582+
}
583+
578584
def isExplanation(result: DataFrame) = {
579585
val explanation = result.select('plan).collect().map { case Row(plan: String) => plan }
580586
explanation.contains("== Physical Plan ==")

0 commit comments

Comments
 (0)