jacktengg opened a new pull request, #11952:
URL: https://github.com/apache/doris/pull/11952

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   For debug purpose: add session variable agg_as_duplicate, when set to true, 
tables of aggregate key model and unique key model will be read as duplicate 
key model:
   ```
   mysql> create table t1(a int, b int) engine = olap unique key (a) 
distributed by hash(a) buckets 16 properties("replication_allocation" = 
"tag.location.default: 1");
   Query OK, 0 rows affected (0.28 sec)
   
   mysql> insert into t1 values (1,1),(2,1);
   Query OK, 2 rows affected (0.25 sec)
   {'label':'insert_e46de5e8df5246d4_ac3d12726252db7b', 'status':'VISIBLE', 
'txnId':'2'}
   
   mysql> select * from t1;
   +------+------+
   | a    | b    |
   +------+------+
   |    2 |    1 |
   |    1 |    1 |
   +------+------+
   2 rows in set (0.47 sec)
   
   mysql> insert into t1 values (1,11),(2,11);
   Query OK, 2 rows affected (0.17 sec)
   {'label':'insert_7c44d5acd7b54bc7_82618edd8eef815b', 'status':'VISIBLE', 
'txnId':'3'}
   
   mysql> select * from t1;
   +------+------+
   | a    | b    |
   +------+------+
   |    1 |   11 |
   |    2 |   11 |
   +------+------+
   2 rows in set (0.36 sec)
   
   mysql> show variables like "%agg%";
   +-----------------------------------+-------+
   | Variable_name                     | Value |
   +-----------------------------------+-------+
   | agg_as_duplicate                  | false |
   | disable_streaming_preaggregations | false |
   +-----------------------------------+-------+
   2 rows in set (0.00 sec)
   
   mysql> set agg_as_duplicate = true;
   Query OK, 0 rows affected (0.01 sec)
   
   mysql> select * from t1;
   +------+------+
   | a    | b    |
   +------+------+
   |    2 |    1 |
   |    2 |   11 |
   |    1 |    1 |
   |    1 |   11 |
   +------+------+
   4 rows in set (0.36 sec)
   ```
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[d...@doris.apache.org](mailto:d...@doris.apache.org) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to