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 show mtmv time should wrapped in double quotation mark… #41501

Open
wants to merge 1 commit into
base: branch-2.1
Choose a base branch
from
Open
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 @@ -93,8 +93,9 @@ public String toString() {
builder.append(" ");
builder.append(timeUnit);
if (!StringUtils.isEmpty(startTime)) {
builder.append(" STARTS ");
builder.append(" STARTS \"");
builder.append(startTime);
builder.append("\"");
}
return builder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MTMVTest {
@Test
public void testToInfoString() {
String expect
= "MTMV{refreshInfo=BUILD IMMEDIATE REFRESH COMPLETE ON SCHEDULE EVERY 2 SECOND STARTS ss, "
= "MTMV{refreshInfo=BUILD IMMEDIATE REFRESH COMPLETE ON SCHEDULE EVERY 2 SECOND STARTS \"ss\", "
+ "querySql='select * from xxx;', "
+ "status=MTMVStatus{state=INIT, schemaChangeDetail='null', refreshState=INIT}, "
+ "envInfo=EnvInfo{ctlId='1', dbId='2'}, "
Expand Down
23 changes: 23 additions & 0 deletions regression-test/suites/mtmv_p0/test_show_create_mtmv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,29 @@ suite("test_show_create_mtmv","mtmv") {
assertTrue(showCreateMTMVResult.toString().contains("BUILD IMMEDIATE REFRESH COMPLETE ON COMMIT"))
assertTrue(showCreateMTMVResult.toString().contains("DISTRIBUTED BY RANDOM BUCKETS AUTO"))


sql """drop materialized view if exists ${mvName};"""
sql """
CREATE MATERIALIZED VIEW ${mvName}
BUILD DEFERRED REFRESH AUTO ON SCHEDULE EVERY 10 DAY starts "9999-01-01 10:10:10"
partition by (`k2`)
DISTRIBUTED BY hash(k1) BUCKETS 2
PROPERTIES (
'replication_num' = '1'
)
AS
SELECT * FROM ${tableName};
"""
showCreateMTMVResult = sql """show CREATE MATERIALIZED VIEW ${mvName}"""
logger.info("showCreateMTMVResult: " + showCreateMTMVResult.toString())
sql """drop materialized view if exists ${mvName};"""
sql """
${showCreateMTMVResult[0][1]}
"""
def showCreateMTMVResultAgain = sql """show CREATE MATERIALIZED VIEW ${mvName}"""
logger.info("showCreateMTMVAgainResult: " + showCreateMTMVResultAgain.toString())
assertEquals(showCreateMTMVResult.toString(), showCreateMTMVResultAgain.toString())

sql """drop table if exists `${tableName}`"""
sql """drop materialized view if exists ${mvName};"""
}
Loading