This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 00a9e1cb6dd branch-4.1: [fix](meta) Rebuild view column lookup after
metadata recovery #69150 (#69482)
00a9e1cb6dd is described below
commit 00a9e1cb6dd99355f1b385e3c3ec5c23ae5a83cf
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 23 14:38:03 2026 +0800
branch-4.1: [fix](meta) Rebuild view column lookup after metadata recovery
#69150 (#69482)
Cherry-picked from #69150
Co-authored-by: feiniaofeiafei <[email protected]>
---
.../main/java/org/apache/doris/catalog/View.java | 1 +
.../org/apache/doris/catalog/ViewReplayTest.java | 51 ++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
b/fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
index 7545d8f0e7c..a31ccb40eb1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
@@ -169,6 +169,7 @@ public class View extends Table implements
GsonPostProcessable, ViewIf {
@Override
public void gsonPostProcess() throws IOException {
+ super.gsonPostProcess();
originalViewDef = "";
if (sessionVariables == null) {
sessionVariables = Maps.newHashMap();
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/catalog/ViewReplayTest.java
b/fe/fe-core/src/test/java/org/apache/doris/catalog/ViewReplayTest.java
new file mode 100644
index 00000000000..d344735e5f3
--- /dev/null
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/ViewReplayTest.java
@@ -0,0 +1,51 @@
+// 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.
+
+package org.apache.doris.catalog;
+
+import org.apache.doris.persist.CreateTableInfo;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.util.Collections;
+
+public class ViewReplayTest {
+ @Test
+ public void testColumnLookupAfterDeserialization() throws Exception {
+ View view = new View(1L, "v", Collections.singletonList(
+ new Column("user_name", ScalarType.createVarcharType(20))));
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ view.write(new DataOutputStream(bytes));
+ Table imageView = Table.read(new DataInputStream(new
ByteArrayInputStream(bytes.toByteArray())));
+ bytes.reset();
+ new CreateTableInfo("test", 2L, view).write(new
DataOutputStream(bytes));
+ Table journalView = CreateTableInfo.read(new DataInputStream(
+ new ByteArrayInputStream(bytes.toByteArray()))).getTable();
+ for (Table restored : new Table[] {imageView, journalView}) {
+ Assertions.assertInstanceOf(View.class, restored);
+ Assertions.assertEquals(1, restored.getFullSchema().size());
+ Assertions.assertSame(restored.getFullSchema().get(0),
restored.getColumn("user_name"));
+ Assertions.assertSame(restored.getColumn("user_name"),
restored.getColumn("USER_NAME"));
+ Assertions.assertNull(restored.getColumn("missing"));
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]