You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "strongduanmu (via GitHub)" <gi...@apache.org> on 2026/07/20 05:16:21 UTC
[PR] Add Hive CTAS and window function parsing [shardingsphere]
strongduanmu opened a new pull request, #39188:
URL: https://github.com/apache/shardingsphere/pull/39188
Fixes N/A.
Changes proposed in this pull request:
- Add Hive `CREATE TABLE AS SELECT` visitor support to attach the parsed `SELECT` statement to `CreateTableStatement`.
- Add Hive window function and windowing clause visitor support for parameters, partition clauses, order clauses, frames, and named windows.
- Add Hive visitor unit tests and parser IT cases for CTAS and window function parsing.
Local checks before pull request creation:
- `./mvnw spotless:apply -Pcheck -T1C`
- `./mvnw checkstyle:check -Pcheck -T1C`
- `./mvnw -pl parser/sql/engine/dialect/hive -am -Dtest=HiveStatementVisitorTest -Dsurefire.failIfNoSpecifiedTests=false test -Pcheck -T1C`
- `./mvnw -pl test/it/parser -am -Dtest=InternalHiveParserIT -Dsurefire.failIfNoSpecifiedTests=false test -Pcheck -T1C`
---
Before committing this PR, I'm sure that I have checked the following options:\n- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.\n- [x] I have self-reviewed the commit code.\n- [ ] I have (or in comment I request) added corresponding labels for the pull request.\n- [ ] I have passed maven check locally : `./mvnw clean install -Prelease -Dmaven.javadoc.skip=true -Djacoco.skip=false -T 1C -Drat.skip=true`.\n- [ ] I have made corresponding changes to the documentation.\n- [x] I have added corresponding unit tests for my changes.\n- [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)\n\nDocumentation and release notes are not changed because this updates parser behavior and parser test coverage only.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Hive CTAS and window function parsing [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #39188:
URL: https://github.com/apache/shardingsphere/pull/39188#issuecomment-5019387264
• ### Correction
**Previous Finding:** Hive CTAS inner SELECT parameter marker is not propagated to top-level `CreateTableStatement`.
**Current Status:** Withdrawn
**Reason:** DDL statements in this reviewed scope are not expected to carry parameter placeholders. Adjacent CTAS visitors also attach the inner `SelectStatement` without making nested parameters part of top-level DDL parameter metadata, so this does not meet
the merge-safety necessity gate.
### Summary
**Review Result: Mergeable**
**Reason:** Code-scope review found no remaining blocker in the reviewed latest PR scope. CI not reviewed by request.
### Evidence
- Hive CTAS syntax is supported by the official Hive DDL manual and by the local Hive grammar at `parser/sql/engine/dialect/hive/src/main/antlr4/imports/hive/DDLStatement.g4:38-40`.
- `HiveDDLStatementVisitor` now attaches the CTAS inner `SelectStatement` to `CreateTableStatement`, and the focused visitor test covers the CTAS table/source extraction path.
- `HiveDMLStatementVisitor` adds window function parsing for `OVER`, partition/order/window specification, and parameter handling for window-function arguments; the focused test covers `first_value(remark, ?)` parameter collection in the SELECT path.
- Parser IT resources add Hive CTAS cases and supported SQL coverage.
- `RELEASE-NOTES.md` includes the parser enhancement entry.
### Review Details
Review Focus: Code Correctness Review. CI not reviewed by request.
Reviewed Scope:
- PR `#39188`, head `b34e2e5f2ffbc00962c3f6bbb2c446401a418c25`
- Base / merge-base `9defc39f28fb43e849c67cbcf1f72b2d17c07e83`
- GitHub file list matched local review scope
- Target dialect: Hive
- Related dialect evidence checked: Doris and SQLServer CTAS visitor behavior
- Syntax references checked:
- https://hive.apache.org/docs/latest/language/languagemanual-ddl/
- https://hive.apache.org/docs/latest/language/languagemanual-windowingandanalytics/
Changed files reviewed:
- `RELEASE-NOTES.md`
- `parser/sql/engine/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/engine/hive/visitor/statement/type/HiveDDLStatementVisitor.java`
- `parser/sql/engine/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/engine/hive/visitor/statement/type/HiveDMLStatementVisitor.java`
- `parser/sql/engine/dialect/hive/src/test/java/org/apache/shardingsphere/sql/parser/engine/hive/visitor/statement/HiveStatementVisitorTest.java`
- `test/it/parser/src/main/resources/case/ddl/create-table.xml`
- `test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml`
Not Reviewed Scope:
- GitHub Actions/check-runs.
- Runtime execution against a real Hive backend.
Verification:
- `./mvnw spotless:apply -Pcheck -T1C`: passed
- `./mvnw checkstyle:check -Pcheck -T1C`: passed
- `./mvnw -pl parser/sql/engine/dialect/hive -am -Dtest=HiveStatementVisitorTest -Dsurefire.failIfNoSpecifiedTests=false test -Pcheck -T1C`: passed
- `./mvnw -pl test/it/parser -am -Dtest=InternalHiveParserIT -Dsurefire.failIfNoSpecifiedTests=false test -Pcheck -T1C`: passed
- `./mvnw clean install -Prelease -Dmaven.javadoc.skip=true -Djacoco.skip=false -T 1C -Drat.skip=true`: passed
Release Note / User Docs:
- Release note is present.
- User docs are not required for this parser coverage enhancement.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Hive CTAS and window function parsing [shardingsphere]
Posted by "FlyingZC (via GitHub)" <gi...@apache.org>.
FlyingZC merged PR #39188:
URL: https://github.com/apache/shardingsphere/pull/39188
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org