fix: support parsing Doris REFRESH MATERIALIZED VIEW, CLEAN PROFILE, and CREATE EXTERNAL RESOURCE#38557
Open
daguimu wants to merge 1 commit intoapache:masterfrom
Open
fix: support parsing Doris REFRESH MATERIALIZED VIEW, CLEAN PROFILE, and CREATE EXTERNAL RESOURCE#38557daguimu wants to merge 1 commit intoapache:masterfrom
daguimu wants to merge 1 commit intoapache:masterfrom
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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