thulab / tsfile

THIS REPO HAS MOVED TO https://github.com/apache/incubator-iotdb. TsFile is a columnar file format designed for time-series data, which supports efficient compression and query. It is easy to integrate TsFile with your IOT big data processing frameworks.
https://github.com/apache/incubator-iotdb
112 stars 22 forks source link

How to append content to an existing tsFile? #150

Open Block2 opened 6 years ago

Block2 commented 6 years ago

I have a question, After I first wrote the content to tsFile, and executed the tsFile. Close () operation, how can I append other content to this tsFile file next time? And it make sure that the content I have inserted previous twice is available. please !

jixuan1989 commented 6 years ago

@xingtanzjr can you answer the question?

jixuan1989 commented 6 years ago
  1. The design of Tsfile is: once been finished, never modify it. So, once you close a tsfile, you cannot append anything any more.

  2. The sentence And it make sure that the content I have inserted previous twice is available confuses me, what do you mean?

Besides, tsfile API has no ability to help you to sort data in the time order, or filter duplicate timestamps. Users must make sure that they writing data by the time order. Otherwise the query result is undefined. If your application may generate data out-of-time-order, you can use IoTDB with SQL, then you do not need to consider the out-of-order problem. You can download IoTDB from http://tsfile.org

Block2 commented 6 years ago

It means that the previous two inserted data can be queried. Now, The query action occurs after the tsfile.close () action. It means I can't append data into this tsFile any more while a query action occurs. Is the query action only available for a finished file?

Block2 commented 6 years ago

Thanks for your answer, it is practical for my problem.

jixuan1989 commented 6 years ago

It means that the previous two inserted data can be queried. Now, The query action occurs after the tsfile.close () action. It means I can't append data into this tsFile any more while a query action occurs. Is the query action only available for a finished file?

Yes. If you want to query without closing the TsFile, you have to use IoTDB (which supports read data from an opened TsFile)