File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -68,19 +68,14 @@ trait CheckAnalysis extends PredicateHelper {
6868 case e if e.dataType != IntegerType => failAnalysis(
6969 s " The limit expression must be integer type, but got " +
7070 e.dataType.catalogString)
71- case _ => // OK
72- }
73-
74- val evalledExpression = limitExpr.eval()
75-
76- evalledExpression match {
77- case null => failAnalysis(
78- " The evaluated limit expression must not be null, but got " +
79- limitExpr.sql)
80- case e if e.asInstanceOf [Int ] < 0 => failAnalysis(
81- " The limit expression must be equal to or greater than 0, but got " +
82- e.asInstanceOf [Int ])
83- case e => // OK
71+ case e =>
72+ e.eval() match {
73+ case null => failAnalysis(
74+ s " The evaluated limit expression must not be null, but got ${limitExpr.sql}" )
75+ case v : Int if v < 0 => failAnalysis(
76+ s " The limit expression must be equal to or greater than 0, but got $v" )
77+ case _ => // OK
78+ }
8479 }
8580 }
8681
You can’t perform that action at this time.
0 commit comments