Skip to content
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 @@ -1386,15 +1386,13 @@ public class Config extends ConfigBase {
/**
* Set the maximum number of rows that can be cached
*/
@ConfField(mutable = true, masterOnly = false, description = {"SQL/Partition Cache可以缓存的最大行数。",
"Maximum number of rows that can be cached in SQL/Partition Cache, is 3000 by default."})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.2 do no have ConfField.description now

@ConfField(mutable = true, masterOnly = false)
public static int cache_result_max_row_count = 3000;

/**
* Set the maximum data size that can be cached
*/
@ConfField(mutable = true, masterOnly = false, description = {"SQL/Partition Cache可以缓存的最大数据大小。",
"Maximum data size of rows that can be cached in SQL/Partition Cache, is 3000 by default."})
@ConfField(mutable = true, masterOnly = false)
public static int cache_result_max_data_size = 31457280; // 30M

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ public void analyze(Analyzer analyzer) throws AnalysisException, DdlException {
if (columnDef == null) {
throw new AnalysisException("No column definition in add column clause.");
}
boolean isAggKey = false;
if (tableName != null) {
Table table = Env.getCurrentInternalCatalog().getDbOrDdlException(tableName.getDb())
.getTableOrDdlException(tableName.getTbl());
if (table instanceof OlapTable && ((OlapTable) table).getKeysType() == KeysType.AGG_KEYS
&& columnDef.getAggregateType() == null) {
columnDef.setIsKey(true);
if (table instanceof OlapTable && ((OlapTable) table).getKeysType() == KeysType.AGG_KEYS) {
isAggKey = true;
if (columnDef.getAggregateType() == null) {
columnDef.setIsKey(true);
}
}
}
columnDef.analyze(true);
Expand All @@ -94,6 +97,10 @@ public void analyze(Analyzer analyzer) throws AnalysisException, DdlException {
throw new AnalysisException("Cannot add value column[" + columnDef.getName() + "] at first");
}

if (isAggKey && columnDef.getType().isArrayType()) {
throw new AnalysisException("Array column can't be used in aggregate table");
}

if (Strings.isNullOrEmpty(rollupName)) {
rollupName = null;
}
Expand Down
Loading