Skip to content

Commit defc9f1

Browse files
committed
update
1 parent d725fc9 commit defc9f1

File tree

2 files changed

+3
-4
lines changed
  • sql
    • catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions
    • core/src/main/scala/org/apache/spark/sql/execution/command

2 files changed

+3
-4
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ object Literal {
5757
case b: Byte => Literal(b, ByteType)
5858
case s: Short => Literal(s, ShortType)
5959
case s: String => Literal(UTF8String.fromString(s), StringType)
60-
case s: UTF8String => Literal(s, StringType)
6160
case b: Boolean => Literal(b, BooleanType)
6261
case d: BigDecimal => Literal(Decimal(d), DecimalType(Math.max(d.precision, d.scale), d.scale))
6362
case d: JavaBigDecimal =>

sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,17 +538,17 @@ case class AlterTableDropPartitionCommand(
538538
val partitionSet = {
539539
if (partition._2.nonEmpty) {
540540
val parts = partition._2.map { expr =>
541-
val (attrName, value) = expr match {
541+
val (attrName, constant) = expr match {
542542
case BinaryComparison(UnresolvedAttribute(name :: Nil), constant: Literal) =>
543-
(name, constant.value)
543+
(name, constant)
544544
}
545545
if (!table.partitionColumnNames.exists(resolver(_, attrName))) {
546546
throw new AnalysisException(s"${attrName} is not a valid partition column " +
547547
s"in table ${table.identifier.quotedString}.")
548548
}
549549
val dataType = table.partitionSchema.apply(attrName).dataType
550550
expr.withNewChildren(Seq(AttributeReference(attrName, dataType)(),
551-
Cast(Literal(value), dataType)))
551+
Cast(constant, dataType)))
552552
}.reduce(And)
553553

554554
val partitions = catalog.listPartitionsByFilter(

0 commit comments

Comments
 (0)