morningman commented on a change in pull request #3424:
URL: https://github.com/apache/incubator-doris/pull/3424#discussion_r421610632



##########
File path: be/src/olap/delete_handler.cpp
##########
@@ -105,10 +105,10 @@ OLAPStatus DeleteConditionHandler::check_condition_valid(
     // 检查指定的列是不是key,是不是float或doulbe类型
     const TabletColumn& column = schema.column(field_index);
 
-    if (!column.is_key()
+    if ((!column.is_key() && schema.keys_type() != KeysType::DUP_KEYS)
             || column.type() == OLAP_FIELD_TYPE_DOUBLE
             || column.type() == OLAP_FIELD_TYPE_FLOAT) {
-        LOG(WARNING) << "field is not key column, or its type is float or 
double.";
+        LOG(WARNING) << "field is not key column, or storage model is not 
duplicted, or its type is float or double.";

Review comment:
       ```suggestion
           LOG(WARNING) << "field is not key column, or storage model is not 
duplicated, or its type is float or double.";
   ```

##########
File path: be/src/olap/rowset/column_data.cpp
##########
@@ -509,7 +510,10 @@ int ColumnData::delete_pruning_filter() {
         return DEL_NOT_SATISFIED;
     }
 
-    if (!_segment_group->has_zone_maps()) {
+    int num_zone_maps = _schema.keys_type() == KeysType::DUP_KEYS ? 
_schema.num_columns() : _schema.num_key_columns();

Review comment:
       Does float or double column have ZoneMap?

##########
File path: fe/src/main/java/org/apache/doris/common/Config.java
##########
@@ -1053,7 +1053,7 @@
      * control materialized view
      */
     @ConfField(mutable = true, masterOnly = true)
-    public static boolean enable_materialized_view = false;
+    public static boolean enable_materialized_view = true;

Review comment:
       Do not change this in this PR, better to submit another new PR to change 
it.

##########
File path: fe/src/main/java/org/apache/doris/load/Load.java
##########
@@ -3123,7 +3123,7 @@ private void checkDeleteV2(OlapTable table, Partition 
partition, List<Predicate>
             }
 
             Column column = nameToColumn.get(columnName);
-            if (!column.isKey()) {
+            if (!column.isKey() && table.getKeysType() != KeysType.DUP_KEYS) {

Review comment:
       No need to modify here, this method is deprecated.

##########
File path: fe/src/main/java/org/apache/doris/load/DeleteHandler.java
##########
@@ -509,8 +510,8 @@ private void checkDeleteV2(OlapTable table, Partition 
partition, List<Predicate>
                 if (column == null) {
                     
ErrorReport.reportDdlException(ErrorCode.ERR_BAD_FIELD_ERROR, columnName, 
indexName);
                 }
-
-                if (table.getKeysType() == KeysType.DUP_KEYS && 
!column.isKey()) {
+                MaterializedIndexMeta indexMeta = 
table.getIndexIdToMeta().get(index.getId());
+                if (indexMeta.getKeysType() != KeysType.DUP_KEYS && 
!column.isKey()) {

Review comment:
       if index is DUPLICATED, but column type is float or double, we should 
also forbid the delete operation.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to