You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/01/25 11:33:21 UTC

[GitHub] [incubator-doris] EmmyMiao87 commented on a change in pull request #5252: [Delete] Support delete with multi partitions

EmmyMiao87 commented on a change in pull request #5252:
URL: https://github.com/apache/incubator-doris/pull/5252#discussion_r563550567



##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/DeleteHandler.java
##########
@@ -146,25 +148,35 @@ public void process(DeleteStmt stmt) throws DdlException, QueryStateException {
                     throw new DdlException("Table's state is not normal: " + tableName);
                 }
 
-                if (partitionName == null) {
+                if (noPartitionSpecified) {
                     if (olapTable.getPartitionInfo().getType() == PartitionType.RANGE) {
-                        throw new DdlException("This is a range partitioned table."
-                                + " You should specify partition in delete stmt");
+                        if (!ConnectContext.get().getSessionVariable().isDeleteWithoutPartition()) {

Review comment:
       What is the reason that partition must be included in a range partition table? Is it because of compatibility with the old behavior or other considerations?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
##########
@@ -129,164 +135,167 @@
 
     // query timeout in second.
     @VariableMgr.VarAttr(name = QUERY_TIMEOUT)
-    private int queryTimeoutS = 300;
+    public int queryTimeoutS = 300;
 
     // if true, need report to coordinator when plan fragment execute successfully.
-    @VariableMgr.VarAttr(name = IS_REPORT_SUCCESS)
-    private boolean isReportSucc = false;
+    @VariableMgr.VarAttr(name = IS_REPORT_SUCCESS, needForward = true)
+    public boolean isReportSucc = false;
 
     // Set sqlMode to empty string
-    @VariableMgr.VarAttr(name = SQL_MODE)
-    private long sqlMode = 0L;
+    @VariableMgr.VarAttr(name = SQL_MODE, needForward = true)
+    public long sqlMode = 0L;
 
     @VariableMgr.VarAttr(name = RESOURCE_VARIABLE)
-    private String resourceGroup = "normal";
+    public String resourceGroup = "normal";
 
     // this is used to make mysql client happy
     @VariableMgr.VarAttr(name = AUTO_COMMIT)
-    private boolean autoCommit = true;
+    public boolean autoCommit = true;
 
     // this is used to make c3p0 library happy
     @VariableMgr.VarAttr(name = TX_ISOLATION)
-    private String txIsolation = "REPEATABLE-READ";
+    public String txIsolation = "REPEATABLE-READ";
 
     // this is used to make c3p0 library happy
     @VariableMgr.VarAttr(name = CHARACTER_SET_CLIENT)
-    private String charsetClient = "utf8";
+    public String charsetClient = "utf8";
     @VariableMgr.VarAttr(name = CHARACTER_SET_CONNNECTION)
-    private String charsetConnection = "utf8";
+    public String charsetConnection = "utf8";
     @VariableMgr.VarAttr(name = CHARACTER_SET_RESULTS)
-    private String charsetResults = "utf8";
+    public String charsetResults = "utf8";
     @VariableMgr.VarAttr(name = CHARACTER_SET_SERVER)
-    private String charsetServer = "utf8";
+    public String charsetServer = "utf8";
     @VariableMgr.VarAttr(name = COLLATION_CONNECTION)
-    private String collationConnection = "utf8_general_ci";
+    public String collationConnection = "utf8_general_ci";
     @VariableMgr.VarAttr(name = COLLATION_DATABASE)
-    private String collationDatabase = "utf8_general_ci";
+    public String collationDatabase = "utf8_general_ci";
 
     @VariableMgr.VarAttr(name = COLLATION_SERVER)
-    private String collationServer = "utf8_general_ci";
+    public String collationServer = "utf8_general_ci";
 
     // this is used to make c3p0 library happy
     @VariableMgr.VarAttr(name = SQL_AUTO_IS_NULL)
-    private boolean sqlAutoIsNull = false;
+    public boolean sqlAutoIsNull = false;
 
     @VariableMgr.VarAttr(name = SQL_SELECT_LIMIT)
-    private long sqlSelectLimit = 9223372036854775807L;
+    public long sqlSelectLimit = 9223372036854775807L;
 
     // this is used to make c3p0 library happy
     @VariableMgr.VarAttr(name = MAX_ALLOWED_PACKET)
-    private int maxAllowedPacket = 1048576;
+    public int maxAllowedPacket = 1048576;
 
     @VariableMgr.VarAttr(name = AUTO_INCREMENT_INCREMENT)
-    private int autoIncrementIncrement = 1;
+    public int autoIncrementIncrement = 1;
 
     // this is used to make c3p0 library happy
     @VariableMgr.VarAttr(name = QUERY_CACHE_TYPE)
-    private int queryCacheType = 0;
+    public int queryCacheType = 0;
 
     // The number of seconds the server waits for activity on an interactive connection before closing it
     @VariableMgr.VarAttr(name = INTERACTIVE_TIMTOUT)
-    private int interactiveTimeout = 3600;
+    public int interactiveTimeout = 3600;
 
     // The number of seconds the server waits for activity on a noninteractive connection before closing it.
     @VariableMgr.VarAttr(name = WAIT_TIMEOUT)
-    private int waitTimeout = 28800;
+    public int waitTimeout = 28800;
 
     // The number of seconds to wait for a block to be written to a connection before aborting the write
     @VariableMgr.VarAttr(name = NET_WRITE_TIMEOUT)
-    private int netWriteTimeout = 60;
+    public int netWriteTimeout = 60;
 
     // The number of seconds to wait for a block to be written to a connection before aborting the write
     @VariableMgr.VarAttr(name = NET_READ_TIMEOUT)
-    private int netReadTimeout = 60;
+    public int netReadTimeout = 60;
 
     // The current time zone
-    @VariableMgr.VarAttr(name = TIME_ZONE)
-    private String timeZone = TimeUtils.getSystemTimeZone().getID();
+    @VariableMgr.VarAttr(name = TIME_ZONE, needForward = true)
+    public String timeZone = TimeUtils.getSystemTimeZone().getID();
 
     @VariableMgr.VarAttr(name = PARALLEL_EXCHANGE_INSTANCE_NUM)
-    private int exchangeInstanceParallel = -1;
+    public int exchangeInstanceParallel = -1;
 
     @VariableMgr.VarAttr(name = SQL_SAFE_UPDATES)
-    private int sqlSafeUpdates = 0;
+    public int sqlSafeUpdates = 0;
 
     // only
     @VariableMgr.VarAttr(name = NET_BUFFER_LENGTH, flag = VariableMgr.READ_ONLY)
-    private int netBufferLength = 16384;
+    public int netBufferLength = 16384;
 
     // if true, need report to coordinator when plan fragment execute successfully.
     @VariableMgr.VarAttr(name = CODEGEN_LEVEL)
-    private int codegenLevel = 0;
+    public int codegenLevel = 0;
 
     @VariableMgr.VarAttr(name = BATCH_SIZE)
-    private int batchSize = 1024;
+    public int batchSize = 1024;
 
     @VariableMgr.VarAttr(name = DISABLE_STREAMING_PREAGGREGATIONS)
-    private boolean disableStreamPreaggregations = false;
+    public boolean disableStreamPreaggregations = false;
 
     @VariableMgr.VarAttr(name = DISABLE_COLOCATE_JOIN)
-    private boolean disableColocateJoin = false;
+    public boolean disableColocateJoin = false;
 
     @VariableMgr.VarAttr(name = ENABLE_BUCKET_SHUFFLE_JOIN)
-    private boolean enableBucketShuffleJoin = false;
+    public boolean enableBucketShuffleJoin = false;
 
     @VariableMgr.VarAttr(name = PREFER_JOIN_METHOD)
-    private String preferJoinMethod = "broadcast";
+    public String preferJoinMethod = "broadcast";
 
     /*
      * the parallel exec instance num for one Fragment in one BE
      * 1 means disable this feature
      */
     @VariableMgr.VarAttr(name = PARALLEL_FRAGMENT_EXEC_INSTANCE_NUM)
-    private int parallelExecInstanceNum = 1;
+    public int parallelExecInstanceNum = 1;
 
-    @VariableMgr.VarAttr(name = ENABLE_INSERT_STRICT)
-    private boolean enableInsertStrict = false;
+    @VariableMgr.VarAttr(name = ENABLE_INSERT_STRICT, needForward = true)
+    public boolean enableInsertStrict = false;
 
     @VariableMgr.VarAttr(name = ENABLE_ODBC_TRANSCATION)
-    private boolean enableOdbcTransaction = false;
+    public boolean enableOdbcTransaction = false;
 
     @VariableMgr.VarAttr(name = ENABLE_SQL_CACHE)
-    private boolean enableSqlCache = false;
+    public boolean enableSqlCache = false;
 
     @VariableMgr.VarAttr(name = ENABLE_PARTITION_CACHE)
-    private boolean enablePartitionCache = false;
+    public boolean enablePartitionCache = false;
 
     @VariableMgr.VarAttr(name = FORWARD_TO_MASTER)
-    private boolean forwardToMaster = false;
+    public boolean forwardToMaster = false;
 
     @VariableMgr.VarAttr(name = LOAD_MEM_LIMIT)
-    private long loadMemLimit = 0L;
+    public long loadMemLimit = 0L;
 
     @VariableMgr.VarAttr(name = USE_V2_ROLLUP)
-    private boolean useV2Rollup = false;
+    public boolean useV2Rollup = false;
 
     // TODO(ml): remove it after test
     @VariableMgr.VarAttr(name = TEST_MATERIALIZED_VIEW)
-    private boolean testMaterializedView = false;
+    public boolean testMaterializedView = false;
 
     @VariableMgr.VarAttr(name = REWRITE_COUNT_DISTINCT_TO_BITMAP_HLL)
-    private boolean rewriteCountDistinct = true;
+    public boolean rewriteCountDistinct = true;
 
     // compatible with some mysql client connect, say DataGrip of JetBrains
     @VariableMgr.VarAttr(name = EVENT_SCHEDULER)
-    private String eventScheduler = "OFF";
+    public String eventScheduler = "OFF";
     @VariableMgr.VarAttr(name = STORAGE_ENGINE)
-    private String storageEngine = "olap";
+    public String storageEngine = "olap";
     @VariableMgr.VarAttr(name = DIV_PRECISION_INCREMENT)
-    private int divPrecisionIncrement = 4;
+    public int divPrecisionIncrement = 4;
 
     // -1 means unset, BE will use its config value
     @VariableMgr.VarAttr(name = MAX_SCAN_KEY_NUM)
-    private int maxScanKeyNum = -1;
+    public int maxScanKeyNum = -1;
     @VariableMgr.VarAttr(name = MAX_PUSHDOWN_CONDITIONS_PER_COLUMN)
-    private int maxPushdownConditionsPerColumn = -1;
+    public int maxPushdownConditionsPerColumn = -1;
     @VariableMgr.VarAttr(name = SHOW_HIDDEN_COLUMNS, flag = VariableMgr.SESSION_ONLY)

Review comment:
       Why change these session variables to public?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/DeleteHandler.java
##########
@@ -146,25 +148,35 @@ public void process(DeleteStmt stmt) throws DdlException, QueryStateException {
                     throw new DdlException("Table's state is not normal: " + tableName);
                 }
 
-                if (partitionName == null) {
+                if (noPartitionSpecified) {
                     if (olapTable.getPartitionInfo().getType() == PartitionType.RANGE) {

Review comment:
       Do you need to consider list partitioning?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org