This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.2 by this push:
new 7e5c7e03dfc branch-4.2: [fix](fe) Return async materialized view
schemas in the legacy metadata API #70784 (#70829)
7e5c7e03dfc is described below
commit 7e5c7e03dfc5e8fb0be8458d2180f7bca2645b55
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Nov 21 12:16:35 2026 +0800
branch-4.2: [fix](fe) Return async materialized view schemas in the legacy
metadata API #70784 (#70829)
Cherry-picked from #70784
Co-authored-by: HSn <[email protected]>
---
.../apache/doris/httpv2/rest/MetaInfoAction.java | 2 +-
.../http_rest_api/get/test_async_mv_schema.groovy | 49 ++++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java
index 1ac0c7f5282..f389bb2fd82 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java
@@ -251,7 +251,7 @@ public class MetaInfoAction extends RestBaseController {
tbl.readLock();
try {
long baseId = -1;
- if (tbl.getType() == Table.TableType.OLAP) {
+ if (tbl.isManagedTable()) {
baseId = ((OlapTable) tbl).getBaseIndexId();
} else {
baseId += tbl.getId();
diff --git
a/regression-test/suites/http_rest_api/get/test_async_mv_schema.groovy
b/regression-test/suites/http_rest_api/get/test_async_mv_schema.groovy
new file mode 100644
index 00000000000..3dcfac00110
--- /dev/null
+++ b/regression-test/suites/http_rest_api/get/test_async_mv_schema.groovy
@@ -0,0 +1,49 @@
+// 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_async_mv_schema") {
+ sql "DROP MATERIALIZED VIEW IF EXISTS test_async_mv_schema"
+ sql "DROP TABLE IF EXISTS test_async_mv_schema_base"
+ sql """
+ CREATE TABLE test_async_mv_schema_base (k INT, v INT)
+ DUPLICATE KEY(k) DISTRIBUTED BY HASH(k) BUCKETS 1
+ PROPERTIES ("replication_num" = "1")
+ """
+ sql """
+ CREATE MATERIALIZED VIEW test_async_mv_schema
+ BUILD DEFERRED REFRESH COMPLETE ON MANUAL
+ DISTRIBUTED BY RANDOM BUCKETS 1
+ PROPERTIES ("replication_num" = "1")
+ AS SELECT k AS mv_key, v AS mv_value FROM test_async_mv_schema_base
+ """
+
+ def db = context.config.getDbNameByFile(context.file)
+ httpTest {
+ basicAuthorization context.config.jdbcUser, context.config.jdbcPassword
+ endpoint context.config.feHttpAddress
+ uri
"/api/meta/namespaces/default_cluster/databases/${db}/tables/test_async_mv_schema/schema"
+ op "get"
+ check { status, body ->
+ assertEquals(200, status)
+ def result = parseJson(body)
+ assertEquals(0, result.code)
+ def view = result.data.test_async_mv_schema
+ assertEquals(true, view.is_base)
+ assertEquals(["mv_key", "mv_value"], view.schema*.Field)
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]