Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the error in parsing the Doris create materialized view #34943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jay841224
Copy link

@jay841224 jay841224 commented Mar 9, 2025

Fixes #31499

Changes proposed in this pull request:
This pull request modify the parsing of the following sql:

CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE
CREATE MATERIALIZED VIEW mv1 REFRESH COMPLETE
CREATE MATERIALIZED VIEW mv1 REFRESH ON SCHEDULE EVERY 2 HOUR STARTS "2023-12-13 21:07:09"
CREATE MATERIALIZED VIEW mv1 KEY(k1,k2)

For the completeness of SQL syntax, I added a simple SELECT at the end to ensure they work properly.

CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE AS SELECT k1, k2 FROM test_table;
CREATE MATERIALIZED VIEW mv1 REFRESH COMPLETE AS SELECT k1, k2 FROM test_table;
CREATE MATERIALIZED VIEW mv1 REFRESH ON SCHEDULE EVERY 2 HOUR STARTS "2023-12-13 21:07:09" AS SELECT k1, k2 FROM test_table;
CREATE MATERIALIZED VIEW mv1 KEY(k1,k2) AS SELECT k1, k2 FROM test_table;

Since the original Doris DDL did not have Materialized Views, I referred to Materialized Views and added parsing syntax in DDLStatement.g4.


Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • 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.
  • I have made corresponding changes to the documentation.
  • 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

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.

Support parsing Doris sql
2 participants