[chore](errmsg) Fix confusing error message and clang tidy hints (#33893)
This commit is contained in:
@ -23,6 +23,8 @@ Checks: |
|
||||
-readability-inconsistent-declaration-parameter-name,
|
||||
-readability-isolate-declaration,
|
||||
-readability-named-parameter,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-convert-member-functions-to-static,
|
||||
portability-simd-intrinsics,
|
||||
performance-type-promotion-in-math-fn,
|
||||
performance-faster-string-find,
|
||||
|
||||
@ -185,9 +185,13 @@ public class PartitionDesc {
|
||||
boolean found = false;
|
||||
for (ColumnDef columnDef : columnDefs) {
|
||||
if (columnDef.getName().equals(partitionCol)) {
|
||||
if (!columnDef.isKey() && (columnDef.getAggregateType() != AggregateType.NONE
|
||||
|| enableUniqueKeyMergeOnWrite)) {
|
||||
throw new AnalysisException("The partition column could not be aggregated column");
|
||||
if (!columnDef.isKey()) {
|
||||
if (columnDef.getAggregateType() != AggregateType.NONE) {
|
||||
throw new AnalysisException("The partition column could not be aggregated column");
|
||||
}
|
||||
if (enableUniqueKeyMergeOnWrite) {
|
||||
throw new AnalysisException("Merge-on-Write table's partition column must be KEY column");
|
||||
}
|
||||
}
|
||||
if (columnDef.getType().isFloatingPointType()) {
|
||||
throw new AnalysisException("Floating point type column can not be partition column");
|
||||
|
||||
@ -121,9 +121,13 @@ public class PartitionTableInfo {
|
||||
|
||||
private void validatePartitionColumn(ColumnDefinition column, ConnectContext ctx,
|
||||
boolean isEnableMergeOnWrite, boolean isExternal) {
|
||||
if (!column.isKey()
|
||||
&& (!column.getAggType().equals(AggregateType.NONE) || isEnableMergeOnWrite)) {
|
||||
throw new AnalysisException("The partition column could not be aggregated column");
|
||||
if (!column.isKey()) { // value column
|
||||
if (!column.getAggType().equals(AggregateType.NONE)) { // agg column
|
||||
throw new AnalysisException("The partition column could not be aggregated column");
|
||||
}
|
||||
if (isEnableMergeOnWrite) { // MoW table
|
||||
throw new AnalysisException("Merge-on-Write table's partition column must be KEY column");
|
||||
}
|
||||
}
|
||||
if (column.getType().isFloatLikeType()) {
|
||||
throw new AnalysisException("Floating point type column can not be partition column");
|
||||
|
||||
Reference in New Issue
Block a user