[FIX](complextype)fix complex type nested version type but not hide version (#30419)
This commit is contained in:
@ -136,26 +136,7 @@ public class DescribeStmt extends ShowStmt {
|
||||
? FeConstants.null_string : column.getDefaultValue(),
|
||||
"NONE"
|
||||
);
|
||||
if (column.getOriginType().isDatetimeV2()) {
|
||||
StringBuilder typeStr = new StringBuilder("DATETIME");
|
||||
if (((ScalarType) column.getOriginType()).getScalarScale() > 0) {
|
||||
typeStr.append("(").append(((ScalarType) column.getOriginType()).getScalarScale()).append(")");
|
||||
}
|
||||
row.set(1, typeStr.toString());
|
||||
} else if (column.getOriginType().isDateV2()) {
|
||||
row.set(1, "DATE");
|
||||
} else if (column.getOriginType().isDecimalV3()) {
|
||||
StringBuilder typeStr = new StringBuilder("DECIMAL");
|
||||
ScalarType sType = (ScalarType) column.getOriginType();
|
||||
int scale = sType.getScalarScale();
|
||||
int precision = sType.getScalarPrecision();
|
||||
// not default
|
||||
if (scale > 0 && precision != 9) {
|
||||
typeStr.append("(").append(precision).append(", ").append(scale)
|
||||
.append(")");
|
||||
}
|
||||
row.set(1, typeStr.toString());
|
||||
}
|
||||
row.set(1, column.getOriginType().hideVersionForVersionColumn(false));
|
||||
totalRows.add(row);
|
||||
}
|
||||
return;
|
||||
|
||||
@ -783,26 +783,7 @@ public class Column implements Writable, GsonPostProcessable {
|
||||
|
||||
// show change datetimeV2/dateV2 to datetime/date
|
||||
if (isCompatible) {
|
||||
if (type.isDatetimeV2()) {
|
||||
sb.append("DATETIME");
|
||||
if (((ScalarType) type).getScalarScale() > 0) {
|
||||
sb.append("(").append(((ScalarType) type).getScalarScale()).append(")");
|
||||
}
|
||||
} else if (type.isDateV2()) {
|
||||
sb.append("DATE");
|
||||
} else if (type.isDecimalV3()) {
|
||||
sb.append("DECIMAL");
|
||||
ScalarType sType = (ScalarType) type;
|
||||
int scale = sType.getScalarScale();
|
||||
int precision = sType.getScalarPrecision();
|
||||
// not default
|
||||
if (!sType.isDefaultDecimal()) {
|
||||
sb.append("(").append(precision).append(", ").append(scale)
|
||||
.append(")");
|
||||
}
|
||||
} else {
|
||||
sb.append(typeStr);
|
||||
}
|
||||
sb.append(type.hideVersionForVersionColumn(true));
|
||||
} else {
|
||||
sb.append(typeStr);
|
||||
}
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
package org.apache.doris.common.proc;
|
||||
|
||||
import org.apache.doris.catalog.Column;
|
||||
import org.apache.doris.catalog.ScalarType;
|
||||
import org.apache.doris.common.AnalysisException;
|
||||
import org.apache.doris.common.FeConstants;
|
||||
|
||||
@ -76,28 +75,7 @@ public class IndexSchemaProcNode implements ProcNodeInterface {
|
||||
? FeConstants.null_string : column.getDefaultValue(),
|
||||
extraStr);
|
||||
|
||||
if (column.getOriginType().isDateV2()) {
|
||||
rowList.set(1, "DATE");
|
||||
}
|
||||
if (column.getOriginType().isDatetimeV2()) {
|
||||
StringBuilder typeStr = new StringBuilder("DATETIME");
|
||||
if (((ScalarType) column.getOriginType()).getScalarScale() > 0) {
|
||||
typeStr.append("(").append(((ScalarType) column.getOriginType()).getScalarScale()).append(")");
|
||||
}
|
||||
rowList.set(1, typeStr.toString());
|
||||
}
|
||||
if (column.getOriginType().isDecimalV3()) {
|
||||
StringBuilder typeStr = new StringBuilder("DECIMAL");
|
||||
ScalarType sType = (ScalarType) column.getOriginType();
|
||||
int scale = sType.getScalarScale();
|
||||
int precision = sType.getScalarPrecision();
|
||||
// not default
|
||||
if (scale > 0 && precision != 9) {
|
||||
typeStr.append("(").append(precision).append(", ").append(scale)
|
||||
.append(")");
|
||||
}
|
||||
rowList.set(1, typeStr.toString());
|
||||
}
|
||||
rowList.set(1, column.getOriginType().hideVersionForVersionColumn(false));
|
||||
result.addRow(rowList);
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user