2

I'm trying to migrate data to QuestDB and inserting historical records, I create table as

create table records(
type INT,
interval INT,
timestamp TIMESTAMP,
name STRING) timestamp(timestamp)

and insert data from CSV by curl uploading it.

I get back error "Cannot insert rows out of order". I read that out of order was supported in QuestDB but somehow I cannot make it work.

Doncarleone512
  • 346
  • 1
  • 7

1 Answers1

4

You can insert rows out of order on partitioned tables only, create new partitioned table and copy data into it

create table records2(
 type INT,
 interval INT,
 timestamp TIMESTAMP,
 name STRING
) 
timestamp(timestamp) partition by DAY

insert into records2
select * from records

drop table records

rename table records2 to records

After this you'll be able to insert out of order into table records

djbobo
  • 487
  • 2
  • 6