fix: support parsing Doris REFRESH MATERIALIZED VIEW, CLEAN PROFILE, and CREATE EXTERNAL RESOURCE#38557
fix: support parsing Doris REFRESH MATERIALIZED VIEW, CLEAN PROFILE, and CREATE EXTERNAL RESOURCE#38557daguimu wants to merge 2 commits into
Conversation
…and CREATE EXTERNAL RESOURCE SQL Add ANTLR grammar rules, visitor implementations, statement classes, and test cases for the following Doris SQL statements: - REFRESH MATERIALIZED VIEW with AUTO, COMPLETE, and PARTITIONS variants - CLEAN PROFILE keyword - CREATE EXTERNAL RESOURCE with PROPERTIES clause Fixes apache#31457
|
Hi, I have just addressed the Spotless violations in a follow-up commit; CI should now pass. Would appreciate a review when someone has time. Thanks! |
terrymanu
left a comment
There was a problem hiding this comment.
Please resolve conflicts and fix checkstyle first
|
Hi @daguimu, thanks again for working on this Doris parser issue. I am going to close this PR because it has had no response or update for a long time after the change request to resolve conflicts and fix Checkstyle, and the current approach also needs to be revisited. For #31457, The linked issue remains open, and you are very welcome to submit a new PR later with a smaller and clarified scope. Thanks again for your contribution. |
Problem
ShardingSphere's Doris SQL parser does not support parsing the following SQL statements:
REFRESH MATERIALIZED VIEW mv1 AUTOREFRESH MATERIALIZED VIEW mv1 COMPLETEREFRESH MATERIALIZED VIEW mv1 PARTITIONS(p1, p2)CLEAN PROFILECREATE EXTERNAL RESOURCE "name" PROPERTIES (...)These are valid Doris SQL statements documented in the Doris official documentation.
Root Cause
The ANTLR grammar rules for these Doris-specific SQL statements were not defined in the parser.
Fix
Added complete parsing support including:
Grammar Changes
EXTERNALkeyworddorisRefreshMaterializedViewrule withpartitionSpec,COMPLETE, andAUTOvariantscleanProfileandcreateExternalResourcerulesexecuteblockVisitor & Statement Classes
DorisRefreshMaterializedViewStatement(DDL)DorisCleanProfileStatement(DAL)DorisCreateExternalResourceStatement(DAL)DorisDALStatementVisitorandDorisDDLStatementVisitorSQLVisitorRuleentries for all new statementsTests Added
doris_refresh_materialized_view_auto- TestsREFRESH MATERIALIZED VIEW mv1 AUTOdoris_refresh_materialized_view_complete- TestsREFRESH MATERIALIZED VIEW mv1 COMPLETEdoris_refresh_materialized_view_partitions- TestsREFRESH MATERIALIZED VIEW mv1 PARTITIONS(p1, p2)clean_profile- TestsCLEAN PROFILEcreate_external_resource_spark- TestsCREATE EXTERNAL RESOURCEwith Spark propertiescreate_external_resource_odbc- TestsCREATE EXTERNAL RESOURCEwith ODBC propertiesImpact
Only affects Doris SQL parsing. No changes to other database dialects or core functionality.
Fixes #31457