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/29 09:50:07 UTC
[PR] Support Hive parser for insert select columns and transform expressions [shardingsphere]
strongduanmu opened a new pull request, #39269:
URL: https://github.com/apache/shardingsphere/pull/39269
Related to #36694.
Changes proposed in this pull request:
- Support Hive INSERT ... SELECT with target columns and WITH INSERT parsing.
- Preserve Hive TRANSFORM, MAP and REDUCE input expressions in SelectStatement.
- Parse aggregation window segments and Hive grouping extensions for parser IT.
- Add Hive visitor tests and parser IT expected cases.
---
Before committing this PR, I'm sure that I have checked the following options:
- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [x] I have self-reviewed the commit code.
- [x] I have (or in comment I request) added corresponding labels for the pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [x] I have made corresponding changes to the documentation.
- [x] I have added corresponding unit tests for my changes.
- [ ] 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/)
Local verification:
- `./mvnw -pl parser/sql/statement/core,parser/sql/engine/dialect/hive -am -Dtest=SelectStatementTest,HiveStatementVisitorTest -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dspotless.skip=true -Dcheckstyle.skip=true -Dmaven.repo.local=/Users/duanzhengqiang/Downloads/tmp2 -s ~/.m2/sphereex-settings.xml test`
- `./mvnw -pl test/it/parser -am -Dtest=org.apache.shardingsphere.test.it.sql.parser.hive.InternalHiveParserIT -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dspotless.skip=true -Dcheckstyle.skip=true -Dmaven.repo.local=/Users/duanzhengqiang/Downloads/tmp2 -s ~/.m2/sphereex-settings.xml test`
- `./mvnw spotless:apply -Pcheck -T1C -Dmaven.repo.local=/Users/duanzhengqiang/Downloads/tmp2 -s ~/.m2/sphereex-settings.xml`
- `./mvnw checkstyle:check -Pcheck -T1C -Dmaven.repo.local=/Users/duanzhengqiang/Downloads/tmp2 -s ~/.m2/sphereex-settings.xml`
--
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] Support Hive parser and binder for insert select columns and transform expressions [shardingsphere]
Posted by "FlyingZC (via GitHub)" <gi...@apache.org>.
FlyingZC merged PR #39269:
URL: https://github.com/apache/shardingsphere/pull/39269
--
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] Support Hive parser and binder for insert select columns and transform expressions [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #39269:
URL: https://github.com/apache/shardingsphere/pull/39269#issuecomment-5116698235
• ### Result
**Review Result: Mergeable**
This is a code-correctness review for PR `apache/shardingsphere#39269` at head `4762f17a68cdd9d5273410fda599d8687d3bb652`.
No blocking issue was found in the changed Hive parser, SQL statement model, Binder logic, or related tests. Local CI checks passed. GitHub Actions were still pending at the time of review, so the mergeability conclusion is based on
local verification and code review evidence.
### Evidence
Reviewed scope:
- Hive parser changes for `INSERT ... SELECT`, `WITH ... INSERT`, `TRANSFORM`, `MAP`, `REDUCE`, grouping extensions, and aggregation windows.
- SQL statement model changes for `SelectStatement`, `InsertStatement`, and `SimpleTableSegment`.
- Binder changes for projections, aggregation distinct projections, simple table segments, insert statements, and select statements.
- Corresponding unit tests and parser IT case updates.
Local verification passed:
- `./mvnw spotless:check -Pcheck -T1C ...`
- `./mvnw checkstyle:check -Pcheck -T1C ...`
- Parser scoped tests:
- `SelectStatementTest`
- `HiveStatementVisitorTest`
- Binder scoped tests:
- `AggregationDistinctProjectionSegmentBinderTest`
- `SimpleTableSegmentBinderTest`
- `InsertStatementBinderTest`
- `SelectStatementBinderTest`
### Review Notes
The parser changes preserve the existing Hive visitor flow while adding missing AST metadata for Hive-specific query forms. The Binder changes copy the newly modeled metadata instead of changing downstream rewrite behavior.
The `overwrite` field is currently copied by the Binder and covered by tests. I did not find a current production consumer that depends on this field yet, so this is treated as model completeness rather than a behavioral risk.
The grouping extension handling uses the existing `GroupBySegment` representation and marks grouping extension presence explicitly. This matches the current model shape and is covered by visitor tests.
### Coverage
Files reviewed include parser grammar, Hive visitor, core statement model classes, Binder classes, release note, and related tests. The review did not identify regressions in the changed code paths.
Conclusion: the PR is acceptable from local CI and code-correctness review perspective. Continue to monitor GitHub Actions; if a remote job fails, handle that job’s log directly.
--
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] Support Hive parser and binder for insert select columns and transform expressions [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #39269:
URL: https://github.com/apache/shardingsphere/pull/39269#issuecomment-5116700313
<img width="1920" height="1034" alt="image" src="https://github.com/user-attachments/assets/03bbdbd1-8530-4e75-836e-a47aa8d732b3" />
--
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