Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array type in primary and unique key. #1723

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void analyze(boolean isOlap) throws AnalysisException {
String.format("Cannot specify aggregate function '%s' for key column '%s'", aggregateType,
name));
}
if (!aggregateType.checkCompatibility(type.getPrimitiveType())) {
if (!aggregateType.checkCompatibility(type)) {
throw new AnalysisException(
String.format("Invalid aggregate function '%s' for '%s'", aggregateType, name));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public enum AggregateType {
this.sqlName = sqlName;
}

public static boolean checkCompatibility(AggregateType aggType, PrimitiveType priType) {
public static boolean checkPrimitiveTypeCompatibility(AggregateType aggType, PrimitiveType priType) {
return compatibilityMap.get(aggType).contains(priType);
}

Expand All @@ -139,8 +139,8 @@ public String toString() {
return toSql();
}

public boolean checkCompatibility(PrimitiveType priType) {
return checkCompatibility(this, priType);
public boolean checkCompatibility(Type type) {
return checkPrimitiveTypeCompatibility(this, type.getPrimitiveType()) || (this.isReplaceFamily() && type.isArrayType());
}

public boolean isReplaceFamily() {
Expand Down