Skip to content

Commit d063e3a

Browse files
jzhugegatorsmile
authored andcommitted
[SPARK-24940][SQL] Use IntegerLiteral in ResolveCoalesceHints
## What changes were proposed in this pull request? Follow up to fix an unmerged review comment. ## How was this patch tested? Unit test ResolveHintsSuite. Author: John Zhuge <[email protected]> Closes apache#21998 from jzhuge/SPARK-24940.
1 parent 64ad7b8 commit d063e3a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveHints.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ package org.apache.spark.sql.catalyst.analysis
2020
import java.util.Locale
2121

2222
import org.apache.spark.sql.AnalysisException
23-
import org.apache.spark.sql.catalyst.expressions.Literal
23+
import org.apache.spark.sql.catalyst.expressions.IntegerLiteral
2424
import org.apache.spark.sql.catalyst.plans.logical._
2525
import org.apache.spark.sql.catalyst.rules.Rule
2626
import org.apache.spark.sql.catalyst.trees.CurrentOrigin
2727
import org.apache.spark.sql.internal.SQLConf
28-
import org.apache.spark.sql.types.IntegerType
2928

3029

3130
/**
@@ -119,7 +118,7 @@ object ResolveHints {
119118
case "COALESCE" => false
120119
}
121120
val numPartitions = h.parameters match {
122-
case Seq(Literal(numPartitions: Int, IntegerType)) =>
121+
case Seq(IntegerLiteral(numPartitions)) =>
123122
numPartitions
124123
case Seq(numPartitions: Int) =>
125124
numPartitions

0 commit comments

Comments
 (0)