-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](mtmv)fix mtmv can not refresh when a partition table not have partition #55468
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
800f3d8
1
zddr bde7025
1
zddr c4c2584
1
zddr c5f8221
1
zddr 815e963
1
zddr 858ba12
1
zddr ad2a76a
Merge branch 'master' into fix_mtmv_hive_nodata
zddr e8e382e
Merge branch 'master' into fix_mtmv_hive_nodata
zddr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
81 changes: 81 additions & 0 deletions
81
regression-test/suites/mtmv_p0/test_hive_empty_partition_mtmv.groovy
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| suite("test_hive_empty_partition_mtmv", "p0,external,hive,external_docker,external_docker_hive") { | ||
| String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
| if (enabled == null || !enabled.equalsIgnoreCase("true")) { | ||
| logger.info("diable Hive test.") | ||
| return; | ||
| } | ||
| String suiteName = "test_excluded_trigger_table_mtmv" | ||
| String dbName = "default"; | ||
| String tableName = "${suiteName}_empty_table" | ||
| String mvName = "${suiteName}_mv" | ||
| for (String hivePrefix : ["hive2", "hive3"]) { | ||
| setHivePrefix(hivePrefix) | ||
| // prepare catalog | ||
| String hms_port = context.config.otherConfigs.get(hivePrefix + "HmsPort") | ||
| String catalogName = "${hivePrefix}_${suiteName}_catalog" | ||
| String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
|
||
| sql """drop catalog if exists ${catalogName}""" | ||
| sql """create catalog if not exists ${catalogName} properties ( | ||
| "type"="hms", | ||
| 'hive.metastore.uris' = 'thrift://${externalEnvIp}:${hms_port}' | ||
| );""" | ||
| sql """drop table if exists ${catalogName}.`${dbName}`.${tableName};""" | ||
| sql """ | ||
| CREATE TABLE ${catalogName}.`${dbName}`.${tableName} ( | ||
| `col1` BOOLEAN COMMENT 'col1', | ||
| `pt1` VARCHAR COMMENT 'pt1' | ||
| ) ENGINE=hive | ||
| PARTITION BY LIST (pt1) () | ||
| PROPERTIES ( | ||
| 'file_format'='orc', | ||
| 'compression'='zlib' | ||
| ); | ||
| """ | ||
| // partition | ||
| sql """drop materialized view if exists ${mvName};""" | ||
| sql """ | ||
| CREATE MATERIALIZED VIEW ${mvName} | ||
| REFRESH AUTO ON MANUAL | ||
| partition by(`pt1`) | ||
| DISTRIBUTED BY RANDOM BUCKETS 2 | ||
| PROPERTIES ('replication_num' = '1') | ||
| AS | ||
| SELECT * FROM ${catalogName}.`${dbName}`.${tableName}; | ||
| """ | ||
| waitingMTMVTaskFinishedByMvName(mvName) | ||
| // not partition | ||
| sql """drop materialized view if exists ${mvName};""" | ||
| sql """ | ||
| CREATE MATERIALIZED VIEW ${mvName} | ||
| REFRESH AUTO ON MANUAL | ||
| DISTRIBUTED BY RANDOM BUCKETS 2 | ||
| PROPERTIES ('replication_num' = '1') | ||
| AS | ||
| SELECT * FROM ${catalogName}.`${dbName}`.${tableName}; | ||
| """ | ||
| waitingMTMVTaskFinishedByMvName(mvName) | ||
|
|
||
| sql """drop materialized view if exists ${mvName};""" | ||
| sql """drop table if exists ${catalogName}.`${dbName}`.${tableName};""" | ||
| sql """drop catalog if exists ${catalogName}""" | ||
| } | ||
| } | ||
|
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not mtmvMaxTimestampSnapshot,this need to record a value, whatever max or min ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes