vladanvasi-db opened a new pull request, #59746:
URL: https://github.com/apache/spark/pull/59746

   ### What changes were proposed in this pull request?
   
   Jira: [SPARK-60505](https://issues.apache.org/jira/browse/SPARK-60505)
   
   Follow-up to SPARK-60422 (#59646). This moves more of 
`ResolveSessionCatalog` into shared helpers:
   
   - `v1CommandExtractors.scala` (Catalyst) now holds the V1 command target 
extractors that used to be members of `ResolveSessionCatalog`: 
`ResolvedViewIdentifier`, `ResolvedV1TableIdentifier`, 
`ResolvedV1TableIdentifierInSessionCatalog`, `ResolvedV1TableOrViewIdentifier`, 
`ResolvedIdentifierInSessionCatalog`, `ResolvedV1Database`, 
`ResolvedDatabaseInSessionCatalog` and `DatabaseNameInSessionCatalog`. 
`ResolvedV1CommandIdentifier` moves into the same file. Their names and bodies 
are unchanged, so the rule's cases are unchanged too.
   - `ViewCommandHelper.rewrite(dropView)` (sql/core) now does the 
session-catalog `DROP VIEW` lowering, and `ResolveSessionCatalog` delegates to 
it. The three existing cases keep their order. Any other `DropView` is returned 
as the same instance, so `ViewCatalog` targets still reach 
`DataSourceV2Strategy`.
   
   ### Why are the changes needed?
   
   `ResolveSessionCatalog` keeps its command lowering, and the extractors it 
uses, inside the rule, so other analyzer code can't reuse them. With the 
extractors moved out, every command lowering matches V1 targets through one 
shared place. Extracting the `DROP VIEW` lowering follows the `DropTableHelper` 
pattern from #59646: the single-pass resolver can lower `DROP VIEW` without 
duplicating the rule's logic. `ViewCommandHelper` is meant to take the other 
view commands as they get extracted.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a refactor only: analyzed plans, errors and command behavior are 
unchanged.
   
   ### How was this patch tested?
   
   Existing tests, run with SBT. All passed:
   
   - `sql`: `PlanResolutionSuite`, v1/v2 `DropViewSuite` and `DropTableSuite`, 
`DataSourceV2MetadataViewSuite`, `GlobalTempViewSuite`, `SimpleSQLViewSuite`, 
`PersistedViewTestSuite`, `LocalTempViewTestSuite`, `GlobalTempViewTestSuite`, 
`MetricViewV2CatalogSuite`, `CreateTableAsSelectSuite`, `CreateTableLikeSuite`, 
and the v1/v2 namespace, SHOW, DESCRIBE, ALTER VIEW and function command suites.
   - `hive`: `org.apache.spark.sql.hive.execution.command.*` and `HiveDDLSuite`.
   - Scalastyle for `catalyst` and `sql`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   This pull request and its description were written by Isaac.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to