diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/proc/IndexSchemaProcNode.java b/fe/fe-core/src/main/java/org/apache/doris/common/proc/IndexSchemaProcNode.java index 73b1f7989d8825..73f626af2bb62b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/proc/IndexSchemaProcNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/proc/IndexSchemaProcNode.java @@ -67,7 +67,7 @@ public ProcResult fetchResult() throws AnalysisException { } String extraStr = StringUtils.join(extras, ","); - List rowList = Arrays.asList(column.getName(), + List rowList = Arrays.asList(column.getDisplayName(), column.getOriginType().toString(), column.isAllowNull() ? "Yes" : "No", ((Boolean) column.isKey()).toString(), diff --git a/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java b/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java index 12da94f8430d60..0336c602acbd80 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java @@ -107,7 +107,7 @@ protected void executeWithoutPassword(BaseRequest request, BaseResponse response } baseInfo.put("type", primitiveType.toString()); baseInfo.put("comment", column.getComment()); - baseInfo.put("name", column.getName()); + baseInfo.put("name", column.getDisplayName()); propList.add(baseInfo); } resultMap.put("status", 200); diff --git a/fe/fe-core/src/test/java/org/apache/doris/common/proc/IndexSchemaProcNodeTest.java b/fe/fe-core/src/test/java/org/apache/doris/common/proc/IndexSchemaProcNodeTest.java new file mode 100644 index 00000000000000..cee6c2cb757e19 --- /dev/null +++ b/fe/fe-core/src/test/java/org/apache/doris/common/proc/IndexSchemaProcNodeTest.java @@ -0,0 +1,55 @@ +// 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.common.proc; + +import org.apache.doris.analysis.FunctionCallExpr; +import org.apache.doris.analysis.SlotRef; +import org.apache.doris.analysis.TableName; +import org.apache.doris.catalog.AggregateType; +import org.apache.doris.catalog.Column; +import org.apache.doris.catalog.Type; +import org.apache.doris.common.AnalysisException; + +import com.google.common.collect.Lists; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.List; + +public class IndexSchemaProcNodeTest { + + @Test + public void testFetchResult() throws AnalysisException { + List columnList = Lists.newArrayList(); + Column column1 = new Column("k1", Type.INT, true, null, true, "", ""); + Column column2 = new Column("mv_bitmap_union_v1", Type.BITMAP, false, AggregateType.BITMAP_UNION, true, "", ""); + TableName tableName = new TableName("db1", "t1"); + SlotRef slotRef = new SlotRef(tableName, "v1"); + FunctionCallExpr functionCallExpr = new FunctionCallExpr("to_bitmap", Lists.newArrayList(slotRef)); + column2.setDefineExpr(functionCallExpr); + columnList.add(column1); + columnList.add(column2); + IndexSchemaProcNode indexSchemaProcNode = new IndexSchemaProcNode(columnList, null); + ProcResult procResult = indexSchemaProcNode.fetchResult(); + Assert.assertEquals(2, procResult.getRows().size()); + Assert.assertTrue(procResult.getRows().get(1).contains(column2.getDisplayName())); + Assert.assertFalse(procResult.getRows().get(1).contains(column2.getName())); + + } +}