Skip to content

Refactor Oracle PL/SQL package type reference parsing - #40583

Merged
FlyingZC merged 1 commit into
apache:masterfrom
strongduanmu:dev-1204
Dec 4, 2026
Merged

FlyingZC merged 1 commit into
apache:masterfrom
strongduanmu:dev-1204

Conversation

@strongduanmu

Copy link
Copy Markdown
Member

No linked public issue.

Changes proposed in this pull request:

  • Retain package type references in anonymous Oracle PL/SQL blocks in declaration order.
  • Assert database link metadata in the existing Oracle CREATE TABLE AS SELECT, CREATE VIEW, and SELECT fixtures.
  • Add Oracle parser integration cases for package-qualified type declarations and a remote table inside a scalar aggregate subquery.

Before submitting this PR, I confirm that:

  • My code follows the code of conduct of this project.
  • I have reviewed my changes.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed the required local checks: ./mvnw clean install -B -T1C -Pcheck.
  • I have updated the relevant documentation, if applicable.
  • I have added or updated unit tests for my changes, if applicable.
  • I have updated the Release Notes of the current development version, if applicable. For more details, see Update Release Note.
  • I have disclosed the tool and affected files or scope for any material AI assistance, as required by the AI-assisted contribution policy.

The coverage is provided by the Oracle parser integration suite. The change to internal parser metadata requires no documentation or release note update.

AI assistance: OpenAI Codex assisted with the Oracle visitor and statement changes, parser XML fixtures, verification, and review.

@strongduanmu

Copy link
Copy Markdown
Member Author

Summary

Anonymous Oracle PL/SQL blocks already collect qualified package type references during parsing. The change exposes those references through the block statement’s existing attribute mechanism and strengthens XML coverage for database links in Oracle SELECT and DDL.

Result

Review Result: Mergeable

The code-correctness review found no blocking issues.

Evidence

  • The block constructor registers its own package-type attribute. The visitor copies the references after collecting columns and before adding nested statements, preserving declaration order and the surrounding operations. Statement constructor, Oracle DDL visitor.
  • The PL/SQL case asserts two package names in encounter order, including the schema owner and source offsets for the qualified reference. The attribute exposes syntactic package references and follows the existing interpretation of two-part type names. PL/SQL XML case, Oracle PL/SQL Record Variables.
  • The database-link expectations cover CTAS, CREATE VIEW, and direct SELECT, including a dotted link name. The nested SELECT case checks the aggregate, the remote-table alias, the link name, and the @ separator. Existing XML case IDs retain their relative order. Nested SELECT XML case, Oracle CREATE DATABASE LINK, Oracle Scalar Subquery Expressions, Oracle Distributed LOBs.
  • The exact-file Spotless and Checkstyle checks passed for both Java owners. Oracle Parser IT passed all 2,106 tests, comprising 2,087 supported and 19 unsupported cases. The full ./mvnw clean install -B -T1C -Pcheck build passed.

Coverage

Reviewed all nine changed files at ec4a80eed30 against e407bdd6e81. This is a local code-correctness assessment. GitHub CI was outside the review scope.

@FlyingZC
FlyingZC merged commit bd5211b into apache:master Dec 4, 2026
24 checks passed
@strongduanmu
strongduanmu deleted the dev-1204 branch December 4, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants