Skip to content

Commit 8468b7f

Browse files
committed
use UnresolvedAttribute.quoted instead
1 parent 6093a78 commit 8468b7f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,9 @@ class Analyzer(override val catalogManager: CatalogManager)
13991399
// ResolveOutputRelation runs, using the query's column names that will match the
14001400
// table names at that point. because resolution happens after a future rule, create
14011401
// an UnresolvedAttribute.
1402-
EqualNullSafe(UnresolvedAttribute(attr.name), Cast(Literal(value), attr.dataType))
1402+
EqualNullSafe(
1403+
UnresolvedAttribute.quoted(attr.name),
1404+
Cast(Literal(value), attr.dataType))
14031405
case None =>
14041406
throw QueryCompilationErrors.unknownStaticPartitionColError(name)
14051407
}

sql/core/src/test/scala/org/apache/spark/sql/connector/InsertIntoTests.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,5 +477,15 @@ trait InsertIntoSQLOnlyTests
477477
verifyTable(t1, spark.table(view))
478478
}
479479
}
480+
481+
test("SPARK-34599: InsertInto: overwrite - dot in the partition column name - static mode") {
482+
import testImplicits._
483+
val t1 = "tbl"
484+
withTable(t1) {
485+
sql(s"CREATE TABLE $t1 (`a.b` string, `c.d` string) USING $v2Format PARTITIONED BY (`a.b`)")
486+
sql(s"INSERT OVERWRITE $t1 PARTITION (`a.b` = 'a') (`c.d`) VALUES('b')")
487+
verifyTable(t1, Seq("a" -> "b").toDF("id", "data"))
488+
}
489+
}
480490
}
481491
}

0 commit comments

Comments
 (0)