zhannngchen commented on code in PR #22785:
URL: https://github.com/apache/doris/pull/22785#discussion_r1289645468
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/AlterRoutineLoadStmt.java:
##########
@@ -111,12 +120,29 @@ public void analyze(Analyzer analyzer) throws
UserException {
checkJobProperties();
// check data source properties
checkDataSourceProperties();
+ checkPartialUpdate();
if (analyzedJobProperties.isEmpty() &&
MapUtils.isEmpty(dataSourceMapProperties)) {
throw new AnalysisException("No properties are specified");
}
}
+ private void checkPartialUpdate() throws UserException {
+ if (!isPartialUpdate) {
+ return;
+ }
+ RoutineLoadJob job = Env.getCurrentEnv().getRoutineLoadManager()
+ .getJob(getDbName(), getLabel());
+ if (job.isMultiTable()) {
+ throw new AnalysisException("load by PARTIAL_COLUMNS is not
supported in multi-table load.");
+ }
+ Database db =
Env.getCurrentInternalCatalog().getDbOrAnalysisException(job.getDbFullName());
+ Table table = db.getTableOrAnalysisException(job.getTableName());
+ if (isPartialUpdate && ((OlapTable) table).getKeysType() !=
KeysType.UNIQUE_KEYS) {
Review Comment:
should use `!((OlapTable) table).getEnableUniqueKeyMergeOnWrite()`
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/AlterRoutineLoadStmt.java:
##########
@@ -111,12 +120,29 @@ public void analyze(Analyzer analyzer) throws
UserException {
checkJobProperties();
// check data source properties
checkDataSourceProperties();
+ checkPartialUpdate();
if (analyzedJobProperties.isEmpty() &&
MapUtils.isEmpty(dataSourceMapProperties)) {
throw new AnalysisException("No properties are specified");
}
}
+ private void checkPartialUpdate() throws UserException {
+ if (!isPartialUpdate) {
+ return;
+ }
+ RoutineLoadJob job = Env.getCurrentEnv().getRoutineLoadManager()
+ .getJob(getDbName(), getLabel());
+ if (job.isMultiTable()) {
+ throw new AnalysisException("load by PARTIAL_COLUMNS is not
supported in multi-table load.");
+ }
+ Database db =
Env.getCurrentInternalCatalog().getDbOrAnalysisException(job.getDbFullName());
+ Table table = db.getTableOrAnalysisException(job.getTableName());
+ if (isPartialUpdate && ((OlapTable) table).getKeysType() !=
KeysType.UNIQUE_KEYS) {
+ throw new AnalysisException("load by PARTIAL_COLUMNS is only
supported in unique tables.");
Review Comment:
"in unique table MoW"
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CreateRoutineLoadStmt.java:
##########
@@ -339,6 +353,9 @@ public void checkDBTable(Analyzer analyzer) throws
AnalysisException {
&& !(table.getType() == Table.TableType.OLAP && ((OlapTable)
table).hasDeleteSign())) {
throw new AnalysisException("load by MERGE or DELETE need to
upgrade table to support batch delete.");
}
+ if (isPartialUpdate && ((OlapTable) table).getKeysType() !=
KeysType.UNIQUE_KEYS) {
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]