You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by 김천구 <ck...@gmail.com> on 2024/01/18 02:11:43 UTC

Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Dear Apache IoTDB Development Team

Greetings, My name is Cheongu Kim and I have a question about IoTDB.
Previously I asked about duplicate tuples at the same time.
And I received a suggestion that using an offset is a solution to my
problem.
e.g.,
origin data: <car_1, 1705396048000, 2.0>, <car_1, 1705396048000, 2.1>
to: <car_1, 1705396048000, 2.0>, <car_1, 1705396048001, 2.1>

While it is possible to adjust the resolution down to milliseconds,
it is not feasible to modify it to seconds as it may yield different query
results
(Because the examination starts from the second level),
Which means only 1000 duplicates can be processed for the same timestamp.
(using offset 0.000s ~ 0.999s)
And my dataset contains a maximum of 2572 occurrences of duplication for
the same timestamp.

Secondly, when using offsets, the addition of the duplicate-checking
process to the data loading phase significantly extends the loading time.
Considering that my dataset sizes are 17.6M, 43.6M, and 168.4M
respectively, it seems impractical to use the offset method, as quick data
loading is crucial for me to complete my tests.
(the estimated loading times are 23h, 58h, and 224h)

So here is my question.
Q1) Is there a way to apply an offset to the timestamp in microseconds in
IoTDB?
       If possible, please provide guidance.

Q2) Is time the only unique key column, or could you provide information on
creating key columns other than time to distinguish duplicates at the
same time?

Q3) If possible, could you recommend an efficient method for loading a
dataset that already contains measured results and has a significant amount
of duplicated timestamps, ensuring data integrity?

Thank you for your time, and I look forward to a positive and helpful
response.

Best regards,
-----------------------------------
Cheongu Kim
ckim191009@gmail.com

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by Yuan Tian <ja...@gmail.com>.
Hi Cheongu,

Q3: I think IoTDB is more like SQL other than NoSQL. And if you use
`non-aligned device`, you can take each sensor as a table, if you `aligned
device,` you can take each device as a table.

Q4: Currently, In IoTDB, we only create an index on time column and there
are no other ways to create a secondary index on other columns(but it's
planned).


Best regards,
--------------------------
Yuan Tian


On Wed, Jan 24, 2024 at 8:36 AM 김천구 <ck...@gmail.com> wrote:

> And I have a few more additional questions.
>
> Q3) Since all information is stored as time and value pairs, can it be said
> that IoTDB is closer to the SQL side rather than NoSQL?
>
> Q4) I'm curious if it's possible to specify an index on the value column
> other than time. I would appreciate it if you could provide the relevant
> syntax.
>

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by 김천구 <ck...@gmail.com>.
And I have a few more additional questions.

Q3) Since all information is stored as time and value pairs, can it be said
that IoTDB is closer to the SQL side rather than NoSQL?

Q4) I'm curious if it's possible to specify an index on the value column
other than time. I would appreciate it if you could provide the relevant
syntax.

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by Yuan Tian <ja...@gmail.com>.
feel free to join our community slack through this url:
https://join.slack.com/t/apacheiotdb/shared_invite/zt-2bolm5rfk-0Yimdz7Kp_ZRCIVgJmxoKA

On Fri, Jan 26, 2024 at 2:37 PM Yuan Tian <ja...@gmail.com> wrote:

> And if you like, we can talk on the slack channel because mail
> lists cannot use attachment.
>
> On Fri, Jan 26, 2024 at 1:25 PM 김천구 <ck...@gmail.com> wrote:
>
>> *Urgent Issue:*
>> I was testing on a Linux server with IoTDB version 1.2.2.
>> After briefly turning it off with 'stop-standalone.sh' and attempting to
>> restart it with 'start-standalone.sh',
>> IoTDB does not start. Upon re-executing 'start-standalone.sh', I checked
>> the 'log_confignode_all.log' file.
>> And continuously found the following message:
>> Leader has not been elected yet, wait for 1 second
>>
>> Furthermore, when I executed 'stop-standalone.sh' after
>> 'start-standalone',
>> I encountered the following:
>>
>> stop-standalone.sh: 60: [[: not found
>> Check whether the internal_port is used..., port is 10710
>> No ConfigNode to stop
>> Maybe you can try to run in sudo mode to detect the process.
>> Check whether the rpc_port is used..., port is 6667
>> No DataNode to stop
>> Maybe you can try to run in sudo mode to detect the process.
>>
>>
>> The datanode log file did not contain any additional information, so it
>> seems that even after executing 'start-standalone.sh'
>> confignode and datanode are not running. Despite the absence of processes
>> using ports 10710 and 10730, it is unclear what the issue might be.
>> Even when executed individually, 'start-confignode.sh' and
>> 'start-datanode.sh' do not initiate successfully.
>>
>> I'm curious if there is any speculation about what could be causing the
>> problem.
>>
>> Best regards,
>> -----------------------------------
>> Cheongu Kim
>> ckim191009@gmail.com
>>
>

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by Yuan Tian <ja...@gmail.com>.
And if you like, we can talk on the slack channel because mail lists cannot
use attachment.

On Fri, Jan 26, 2024 at 1:25 PM 김천구 <ck...@gmail.com> wrote:

> *Urgent Issue:*
> I was testing on a Linux server with IoTDB version 1.2.2.
> After briefly turning it off with 'stop-standalone.sh' and attempting to
> restart it with 'start-standalone.sh',
> IoTDB does not start. Upon re-executing 'start-standalone.sh', I checked
> the 'log_confignode_all.log' file.
> And continuously found the following message:
> Leader has not been elected yet, wait for 1 second
>
> Furthermore, when I executed 'stop-standalone.sh' after 'start-standalone',
> I encountered the following:
>
> stop-standalone.sh: 60: [[: not found
> Check whether the internal_port is used..., port is 10710
> No ConfigNode to stop
> Maybe you can try to run in sudo mode to detect the process.
> Check whether the rpc_port is used..., port is 6667
> No DataNode to stop
> Maybe you can try to run in sudo mode to detect the process.
>
>
> The datanode log file did not contain any additional information, so it
> seems that even after executing 'start-standalone.sh'
> confignode and datanode are not running. Despite the absence of processes
> using ports 10710 and 10730, it is unclear what the issue might be.
> Even when executed individually, 'start-confignode.sh' and
> 'start-datanode.sh' do not initiate successfully.
>
> I'm curious if there is any speculation about what could be causing the
> problem.
>
> Best regards,
> -----------------------------------
> Cheongu Kim
> ckim191009@gmail.com
>

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by Yuan Tian <ja...@gmail.com>.
Hi,

Have you tried to use the up to date V1.3.0? Maybe upgrade is helpful.


Best regards,
------------------------
Yuan Tian

On Fri, Jan 26, 2024 at 1:25 PM 김천구 <ck...@gmail.com> wrote:

> *Urgent Issue:*
> I was testing on a Linux server with IoTDB version 1.2.2.
> After briefly turning it off with 'stop-standalone.sh' and attempting to
> restart it with 'start-standalone.sh',
> IoTDB does not start. Upon re-executing 'start-standalone.sh', I checked
> the 'log_confignode_all.log' file.
> And continuously found the following message:
> Leader has not been elected yet, wait for 1 second
>
> Furthermore, when I executed 'stop-standalone.sh' after 'start-standalone',
> I encountered the following:
>
> stop-standalone.sh: 60: [[: not found
> Check whether the internal_port is used..., port is 10710
> No ConfigNode to stop
> Maybe you can try to run in sudo mode to detect the process.
> Check whether the rpc_port is used..., port is 6667
> No DataNode to stop
> Maybe you can try to run in sudo mode to detect the process.
>
>
> The datanode log file did not contain any additional information, so it
> seems that even after executing 'start-standalone.sh'
> confignode and datanode are not running. Despite the absence of processes
> using ports 10710 and 10730, it is unclear what the issue might be.
> Even when executed individually, 'start-confignode.sh' and
> 'start-datanode.sh' do not initiate successfully.
>
> I'm curious if there is any speculation about what could be causing the
> problem.
>
> Best regards,
> -----------------------------------
> Cheongu Kim
> ckim191009@gmail.com
>

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by 김천구 <ck...@gmail.com>.
*Urgent Issue:*
I was testing on a Linux server with IoTDB version 1.2.2.
After briefly turning it off with 'stop-standalone.sh' and attempting to
restart it with 'start-standalone.sh',
IoTDB does not start. Upon re-executing 'start-standalone.sh', I checked
the 'log_confignode_all.log' file.
And continuously found the following message:
Leader has not been elected yet, wait for 1 second

Furthermore, when I executed 'stop-standalone.sh' after 'start-standalone',
I encountered the following:

stop-standalone.sh: 60: [[: not found
Check whether the internal_port is used..., port is 10710
No ConfigNode to stop
Maybe you can try to run in sudo mode to detect the process.
Check whether the rpc_port is used..., port is 6667
No DataNode to stop
Maybe you can try to run in sudo mode to detect the process.


The datanode log file did not contain any additional information, so it
seems that even after executing 'start-standalone.sh'
confignode and datanode are not running. Despite the absence of processes
using ports 10710 and 10730, it is unclear what the issue might be.
Even when executed individually, 'start-confignode.sh' and
'start-datanode.sh' do not initiate successfully.

I'm curious if there is any speculation about what could be causing the
problem.

Best regards,
-----------------------------------
Cheongu Kim
ckim191009@gmail.com

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by Yuan Tian <ja...@gmail.com>.
If you put objectid into path like `root.db.objectId.carId(timestamp,
longitude)`, you will put data of one car into different devices in IoTDB,
I don't think it's a good idea because the number of devices will expand
and will affect the performance.

If you really want to do this, you can get longitude for one car like
`select longitude from root.db.*.carId where time >= XXX and time <= XXX
align by device`

you can also get longitude for each car like `select longitude from
root.db.*.carId where time >= XXX and time <= XXX align by device`

However, as objectId is meaningless, so the order in result set is also
meaningless.


Best regards,
----------------------
Yuan Tian


On Mon, Jan 22, 2024 at 10:32 AM 김천구 <ck...@gmail.com> wrote:

> Dear Yuan Tian
>
> Thank you for your reply. Your response was very helpful.
> But I have an additional question here.
>
> Since the original data is stored in MongoDB, the issue arises because it
> is not time series data.
> After discussing with my colleagues, we've decided that adding an offset to
> modify the original data is not an option.
> And I found information about using tags in IoTDB. So, I have a question
> regarding the use of tags.
>
> As far as I understand, when using tags in IoTDB, it is done as follows,
> based on what I observed on the website.
>
> root.db.tag1.tag2.device.sensor_value
>
>
> Here comes my question. If I want to attach a unique tag to each tuple to
> avoid duplicates,
> is it possible to use MongoDB's objectId as a tag and create a time series
> like the following in IoTDB?
>
> create timeseries root.db.objectId.device.longitude DOUBLE, encoding=plain
> insert into root.db.objectId.device(timestamp, longitude) values(1, 33.33)
>
> Or is there *any other way* to use the objectId as a tag in IoTDB?
>
>
>
> Secondly, if I were to use such a way, how could I select information such
> as the longitude for each tuple?
>
> select longitude from root.db.**
>
> I couldn't select the data using the method mentioned above. If objectId is
> inserted into a timeseries in the IoTDB tree structure,
> could you please provide guidance on how to access the values of each
> tuple?
>
>
>
> Thank you for your time and assistance on this matter.
>
> Best regards,
> -----------------------------------
> Cheongu Kim
> ckim191009@gmail.com
>

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by 김천구 <ck...@gmail.com>.
Dear Yuan Tian

Thank you for your reply. Your response was very helpful.
But I have an additional question here.

Since the original data is stored in MongoDB, the issue arises because it
is not time series data.
After discussing with my colleagues, we've decided that adding an offset to
modify the original data is not an option.
And I found information about using tags in IoTDB. So, I have a question
regarding the use of tags.

As far as I understand, when using tags in IoTDB, it is done as follows,
based on what I observed on the website.

root.db.tag1.tag2.device.sensor_value


Here comes my question. If I want to attach a unique tag to each tuple to
avoid duplicates,
is it possible to use MongoDB's objectId as a tag and create a time series
like the following in IoTDB?

create timeseries root.db.objectId.device.longitude DOUBLE, encoding=plain
insert into root.db.objectId.device(timestamp, longitude) values(1, 33.33)

Or is there *any other way* to use the objectId as a tag in IoTDB?



Secondly, if I were to use such a way, how could I select information such
as the longitude for each tuple?

select longitude from root.db.**

I couldn't select the data using the method mentioned above. If objectId is
inserted into a timeseries in the IoTDB tree structure,
could you please provide guidance on how to access the values of each tuple?



Thank you for your time and assistance on this matter.

Best regards,
-----------------------------------
Cheongu Kim
ckim191009@gmail.com

Re: Inquiry Regarding Duplicate Tuples at the same time for Apache-IoTDB

Posted by Yuan Tian <ja...@gmail.com>.
Hi Cheongu,

Q1:
As you've mentioned, you can change the time precision from milliseconds to
microseconds to support more data points in one second. In IoTDB, we don't
have a way to automatically do that thing.

Q2:
DeviceId + time is the primary key in IoTDB, so I wonder why you have so
many duplicate timestamps in one car.

Q3:
The loading time is too long, I think you use the wrong insert method,
"7.6M, 43.6M, and 168.4M" is not that large, using the right loading method
and concurrently loading won't take that much time.


BTW, I think you can firstly preprocess your data to make them not have
duplicate timestamps in one car or you can just explain why your data have
so many duplicate timestamps in one car.



Best regards,
------------------------
Yuan Tian


On Thu, Jan 18, 2024 at 10:12 AM 김천구 <ck...@gmail.com> wrote:

> Dear Apache IoTDB Development Team
>
> Greetings, My name is Cheongu Kim and I have a question about IoTDB.
> Previously I asked about duplicate tuples at the same time.
> And I received a suggestion that using an offset is a solution to my
> problem.
> e.g.,
> origin data: <car_1, 1705396048000, 2.0>, <car_1, 1705396048000, 2.1>
> to: <car_1, 1705396048000, 2.0>, <car_1, 1705396048001, 2.1>
>
> While it is possible to adjust the resolution down to milliseconds,
> it is not feasible to modify it to seconds as it may yield different query
> results
> (Because the examination starts from the second level),
> Which means only 1000 duplicates can be processed for the same timestamp.
> (using offset 0.000s ~ 0.999s)
> And my dataset contains a maximum of 2572 occurrences of duplication for
> the same timestamp.
>
> Secondly, when using offsets, the addition of the duplicate-checking
> process to the data loading phase significantly extends the loading time.
> Considering that my dataset sizes are 17.6M, 43.6M, and 168.4M
> respectively, it seems impractical to use the offset method, as quick data
> loading is crucial for me to complete my tests.
> (the estimated loading times are 23h, 58h, and 224h)
>
> So here is my question.
> Q1) Is there a way to apply an offset to the timestamp in microseconds in
> IoTDB?
>        If possible, please provide guidance.
>
> Q2) Is time the only unique key column, or could you provide information on
> creating key columns other than time to distinguish duplicates at the
> same time?
>
> Q3) If possible, could you recommend an efficient method for loading a
> dataset that already contains measured results and has a significant amount
> of duplicated timestamps, ensuring data integrity?
>
> Thank you for your time, and I look forward to a positive and helpful
> response.
>
> Best regards,
> -----------------------------------
> Cheongu Kim
> ckim191009@gmail.com
>