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](mtmv)fix can not create mtmv all use default value #28922

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ private String getOriginSql(ParserRuleContext ctx) {

@Override
public MTMVRefreshTriggerInfo visitRefreshTrigger(RefreshTriggerContext ctx) {
if (ctx == null) {
morningman marked this conversation as resolved.
Show resolved Hide resolved
return new MTMVRefreshTriggerInfo(RefreshTrigger.MANUAL);
}
if (ctx.MANUAL() != null) {
return new MTMVRefreshTriggerInfo(RefreshTrigger.MANUAL);
}
Expand Down Expand Up @@ -662,6 +665,9 @@ public RefreshMethod visitRefreshMethod(RefreshMethodContext ctx) {

@Override
public BuildMode visitBuildMode(BuildModeContext ctx) {
if (ctx == null) {
return BuildMode.IMMEDIATE;
}
if (ctx.DEFERRED() != null) {
return BuildMode.DEFERRED;
} else if (ctx.IMMEDIATE() != null) {
Expand Down
13 changes: 13 additions & 0 deletions regression-test/suites/mtmv_p0/test_build_mtmv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ suite("test_build_mtmv") {
DROP MATERIALIZED VIEW ${mvName}
"""

// use default value
sql """
CREATE MATERIALIZED VIEW ${mvName}
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS
SELECT ${tableName}.username, ${tableNamePv}.pv FROM ${tableName}, ${tableNamePv} WHERE ${tableName}.id=${tableNamePv}.id;
"""

sql """
DROP MATERIALIZED VIEW ${mvName}
"""

// IMMEDIATE schedule interval
sql """
CREATE MATERIALIZED VIEW ${mvName}
Expand Down
Loading