LakshSingla commented on PR #13706:
URL: https://github.com/apache/druid/pull/13706#issuecomment-1409792905

   Tried it out with some of the overlapping segment cases. Test data consists 
of a datasource partitioned by month (2022-02-01/2022-03-01), 28 rows, 
containing one row of data for each day. 
   Following is the query used to ingest the data
   ```INSERT INTO "test_table_5"
   SELECT TIME_PARSE("rtttime") AS __time,* FROM TABLE(
     EXTERN(
       '{"type":"local","files":["/Users/lakshsingla/month_data.json"]}',
       '{"type": "json"}',
       '[{"name":"rtttime","type":"string"}, 
{"name":"sr_serial_number","type":"string"} , 
{"name":"drive_duration","type":"long"} ]'
     )
   )
   PARTITIONED BY MONTH
   ```
   
   1. Ran a replace which partially overlaps the segment and lies completely 
inside
   ```REPLACE INTO "test_table_5"
   OVERWRITE WHERE __time >= TIMESTAMP '2022-01-05' AND __time < TIMESTAMP 
'2022-02-25'
   SELECT * FROM "test_table_4"
   WHERE __time >= TIMESTAMP '2022-02-05' AND __time < TIMESTAMP '2022-02-07'
   PARTITIONED BY DAY
   ```
   
   Earlier this used to throw the `InsertCannotReplaceExistingSegment` error, 
however now it works as expected. The tombstones for the 2022-02-07-2022-02-25 
are generated.
   
   2. Ran a replace which partially overlaps the segment and lies outside it as 
well
   ```REPLACE INTO "test_table_5"
   OVERWRITE WHERE __time >= TIMESTAMP '2022-01-05' AND __time < TIMESTAMP 
'2022-02-25'
   SELECT * FROM "test_table_4"
   WHERE __time >= TIMESTAMP '2022-02-05' AND __time < TIMESTAMP '2022-02-07'
   PARTITIONED BY DAY
   ```
   Earlier this used to throw the `InsertCannotReplaceExistingSegment` error, 
however now it works as expected. The tombstones for the  2022-02-01- 
2022-02-04 2022-02-07-2022-02-25 are generated.


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