You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/04/07 10:31:30 UTC

[GitHub] [druid] abhishekagarwal87 commented on issue #11929: Batch ingestion using SQL INSERT

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: commits-unsubscribe@druid.apache.org

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


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