abhishekagarwal87 commented on issue #11929:
URL: https://github.com/apache/druid/issues/11929#issuecomment-1091535259

   I would like to suggest one change in where we are placing the REPLACE WHERE 
clause.  
   Here are some sample `UPDATE` queries in MySQL
   Update rows that have time in range `[2000-01-01 00:00:00, 2000-01-02 
00:00:00)`
   ```
   UPDATE dst SET field1 = new-value1, field2 = new-value2
   WHERE __time >= TIMESTAMP '2000-01-01 00:00:00' AND __time < TIMESTAMP 
'2000-01-02 00:00:00'
   ```
   
   Update all rows irrespective of time (risky syntax that has led to a lot of 
pain for a lot of people 😄 )
   ```
   UPDATE dst SET field1 = new-value1, field2 = new-value2
   ```
   
   If we want to stay close to MySQL syntax, the where clause for REPLACE 
should really come after the select statement and not before. We do still want 
to have a mandatory where clause (`ALL DATA`) to avoid accidental overwrite of 
the entire data. 


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

Reply via email to