This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new f6c8e10534 [spark] Keep the catalog out of v1 function column names on
Spark 4.2 (#11191)
f6c8e10534 is described below
commit f6c8e105343056a7b0208b4fa2e309df5603354f
Author: YangJie <[email protected]>
AuthorDate: Mon Nov 16 07:55:57 2026 -0500
[spark] Keep the catalog out of v1 function column names on Spark 4.2
(#11191)
---
.../org/apache/paimon/spark/sql/Spark42CompatibilityTest.scala | 9 +++++++++
.../spark/sql/catalyst/catalog/PaimonV1FunctionRegistry.scala | 4 +++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git
a/paimon-spark/paimon-spark-4.2/src/test/scala/org/apache/paimon/spark/sql/Spark42CompatibilityTest.scala
b/paimon-spark/paimon-spark-4.2/src/test/scala/org/apache/paimon/spark/sql/Spark42CompatibilityTest.scala
index 2fe2f9baa1..6c6d6da057 100644
---
a/paimon-spark/paimon-spark-4.2/src/test/scala/org/apache/paimon/spark/sql/Spark42CompatibilityTest.scala
+++
b/paimon-spark/paimon-spark-4.2/src/test/scala/org/apache/paimon/spark/sql/Spark42CompatibilityTest.scala
@@ -120,6 +120,15 @@ class Spark42CompatibilityTest extends QueryTest with
SharedSparkSession {
}
}
+ test("unaliased v1 function call keeps the database-qualified column name") {
+ try {
+ sql("CREATE FUNCTION abs_udf AS
'org.apache.hadoop.hive.ql.udf.generic.GenericUDFAbs'")
+ val df = sql("SELECT abs_udf(-3)")
+ checkAnswer(df, Seq(Row(3)))
+ assert(df.columns.toSeq === Seq("test.abs_udf(-3)"))
+ } finally { sql("DROP FUNCTION IF EXISTS abs_udf") }
+ }
+
private val modes: Seq[(String, String)] = Seq(
"primary-key" -> "'bucket'='1', 'primary-key'='id'",
"append" -> "'bucket'='-1'",
diff --git
a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/catalog/PaimonV1FunctionRegistry.scala
b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/catalog/PaimonV1FunctionRegistry.scala
index a62614568b..24bf90c99d 100644
---
a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/catalog/PaimonV1FunctionRegistry.scala
+++
b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/catalog/PaimonV1FunctionRegistry.scala
@@ -159,7 +159,9 @@ case class PaimonV1FunctionRegistry(session: SparkSession)
extends SQLConfHelper
throw new IllegalArgumentException(s"Cannot load class: $className")
}
val clazz = PaimonUtils.classForName(className)
- val name = func.identifier.unquotedString
+ // The builder name shows up in the default column name of an unaliased
call, so leave out
+ // the catalog that `qualifyIdentifier` keeps on Spark 4.2.
+ val name = func.identifier.copy(catalog = None).unquotedString
(input) => functionExpressionBuilder.makeExpression(name, clazz, input)
}