This is an automated email from the ASF dual-hosted git repository.
uros-b pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 781ca6aeecf0 [SPARK-58357][SQL] Remove unused withCatalogIdentClause
in SparkSqlAstBuilder
781ca6aeecf0 is described below
commit 781ca6aeecf071c47b3b643dafcad39f10a1c6a8
Author: Uros Bojanic <[email protected]>
AuthorDate: Mon Jul 27 04:11:39 2026 +0000
[SPARK-58357][SQL] Remove unused withCatalogIdentClause in
SparkSqlAstBuilder
### What changes were proposed in this pull request?
Removes the unused private method `withCatalogIdentClause` in
`SparkSqlAstBuilder`, along with the `SparkException` and
`PlanWithUnresolvedIdentifier` imports that it was the sole remaining user of.
### Why are the changes needed?
Its only caller (`visitSetCatalog`) was rewritten to call `expression(...)`
directly, leaving the method with zero references. Removing it and its
now-orphaned imports is dead-code cleanup with no behavior change.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pure removal of unreferenced code; existing parser tests unaffected. No new
tests needed.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)
Closes #57548 from uros-b/deadcode-sparksqlparser-withcatalogidentclause.
Lead-authored-by: Uros Bojanic <[email protected]>
Co-authored-by: Uros Bojanic <[email protected]>
Signed-off-by: Uros Bojanic <[email protected]>
---
.../spark/sql/execution/SparkSqlParser.scala | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git
a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
index 9acd0ba6def5..99bb63041136 100644
---
a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
+++
b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
@@ -25,11 +25,10 @@ import scala.jdk.CollectionConverters._
import org.antlr.v4.runtime.ParserRuleContext
import org.antlr.v4.runtime.tree.TerminalNode
-import org.apache.spark.SparkException
import org.apache.spark.sql.catalyst.{FunctionIdentifier, TableIdentifier}
import org.apache.spark.sql.catalyst.analysis.{CurrentNamespace,
GlobalTempView, LocalTempView, PersistedView,
- PlanWithUnresolvedIdentifier, SchemaEvolution, SchemaTypeEvolution,
UnresolvedAttribute,
+ SchemaEvolution, SchemaTypeEvolution, UnresolvedAttribute,
UnresolvedIdentifier, UnresolvedNamespace, UnresolvedPartitionSpec,
UnresolvedProcedure,
UnresolvedTableOrViewSearchPathMode}
import org.apache.spark.sql.catalyst.catalog._
@@ -314,25 +313,6 @@ class SparkSqlAstBuilder extends AstBuilder {
}
}
- private def withCatalogIdentClause(
- ctx: CatalogIdentifierReferenceContext,
- builder: Seq[String] => LogicalPlan): LogicalPlan = {
- val exprCtx = ctx.expression
- if (exprCtx != null) {
- // resolve later in analyzer
- PlanWithUnresolvedIdentifier(withOrigin(exprCtx) { expression(exprCtx)
}, Nil,
- (ident, _) => builder(ident))
- } else if (ctx.errorCapturingIdentifier() != null) {
- // resolve immediately
- builder.apply(Seq(getIdentifierText(ctx.errorCapturingIdentifier())))
- } else if (ctx.stringLit() != null) {
- // resolve immediately
- builder.apply(Seq(string(visitStringLit(ctx.stringLit()))))
- } else {
- throw SparkException.internalError("Invalid catalog name")
- }
- }
-
/**
* Create a [[SetCommand]] logical plan.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]