From e509655a0e5593063151fe97e65ae470d2c8710d Mon Sep 17 00:00:00 2001 From: Lijia Liu Date: Fri, 14 Nov 2025 11:31:23 +0800 Subject: [PATCH] [fix](proc) fix schema proc row data (#57962) ### What problem does this PR solve? `/api/meta/namespaces/NS_KEY/databases/DB_KEY/"tables/TABLE_KEY/schema` will failed. Bug stack: ``` [RestApiExceptionHandler.unexpectedExceptionHandler():61] unexpected exception java.lang.IllegalStateException: null at com.google.common.base.Preconditions.checkState(Preconditions.java:499) ~[guava-33.2.1-jre.jar:?] at org.apache.doris.httpv2.rest.MetaInfoAction.generateSchema(MetaInfoAction.java:289) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.httpv2.rest.MetaInfoAction.generateResult(MetaInfoAction.java:275) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.httpv2.rest.MetaInfoAction.getTableSchema(MetaInfoAction.java:250) ~[doris-fe.jar:1.2-SNAPSHOT] ``` Remove dumplicate comment column in `schema` proc. Related PR: #51047 version 3.0.7+ Co-authored-by: liutang123 --- .../java/org/apache/doris/common/proc/IndexSchemaProcNode.java | 3 +-- .../org/apache/doris/common/proc/IndexSchemaProcNodeTest.java | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) 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 3630dac0c57917..b32dd168ffcdef 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 @@ -85,7 +85,6 @@ public static ProcResult createResult(List schema, Set bfColumns extras.add(column.getExtraInfo()); } String extraStr = StringUtils.join(extras, ","); - String comment = column.getComment(); List rowList = Lists.newArrayList(column.getDisplayName(), column.getOriginType().hideVersionForVersionColumn(true), @@ -93,7 +92,7 @@ public static ProcResult createResult(List schema, Set bfColumns ((Boolean) column.isKey()).toString(), column.getDefaultValue() == null ? FeConstants.null_string : column.getDefaultValue(), - extraStr, comment); + extraStr); for (String additionalColName : additionalColNames) { switch (additionalColName.toLowerCase()) { 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 index 1277ce4476a184..ac8c8b65a7aeb6 100644 --- 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 @@ -50,6 +50,8 @@ public void testFetchResult() throws AnalysisException { Assert.assertEquals(2, procResult.getRows().size()); Assert.assertTrue(procResult.getRows().get(1).contains(column2.getDisplayName())); Assert.assertFalse(procResult.getRows().get(1).contains(column2.getName())); + Assert.assertEquals("The column size should be 6", 6, procResult.getColumnNames().size()); + Assert.assertEquals("The row size should be 6", 6, procResult.getRows().get(1).size()); } }