Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to append content to an existing tsFile? #150

Open
Block2 opened this issue Apr 10, 2018 · 5 comments
Open

How to append content to an existing tsFile? #150

Block2 opened this issue Apr 10, 2018 · 5 comments

Comments

@Block2
Copy link

Block2 commented Apr 10, 2018

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
Copy link
Member

@xingtanzjr can you answer the question?

@jixuan1989
Copy link
Member

  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
Copy link
Author

Block2 commented Apr 10, 2018

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
Copy link
Author

Block2 commented Apr 10, 2018

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

@jixuan1989
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants