[
https://issues.apache.org/jira/browse/IOTDB-447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17028142#comment-17028142
]
Xiangdong Huang commented on IOTDB-447:
---------------------------------------
update:
The above changes bring a new bug:
see:
IoTDB> insert into root.a.sg1.d1(timestamp, s1) values(1, 2.023);
It costs 0.019s
IoTDB> insert into root.a.sg1.d1(timestamp, s1) values(2, 3.023);
It costs 0.002s
IoTDB> insert into root.a.sg1.d2(timestamp, s1) values(2, 1.1);
It costs 0.002s
IoTDB> insert into root.a.sg1.d2(timestamp, s2) values(1, 2.1);
It costs 0.002s
IoTDB> select * from root.a.sg1 group by device;
+-----------------------------------+--------------------+----------+----------+
| Time| Device| s1| s2|
+-----------------------------------+--------------------+----------+----------+
| 1970-01-01T08:00:00.001+08:00| root.a.sg1.d1| 2.023| null|
| 1970-01-01T08:00:00.002+08:00| root.a.sg1.d1| 3.023| null|
| 1970-01-01T08:00:00.001+08:00| root.a.sg1.d2| null| 2.1|
| 1970-01-01T08:00:00.002+08:00| root.a.sg1.d2| 1.1| null|
+-----------------------------------+--------------------+----------+----------+
Total line number = 4
It costs 0.004s
IoTDB> select * from root.a.sg1 where time=1 group by device;
+-----------------------------------+--------------------+----------+----------+
| Time| Device| s1| s2|
+-----------------------------------+--------------------+----------+----------+
| 1970-01-01T08:00:00.001+08:00| root.a.sg1.d1| 2.023| null|
| 1970-01-01T08:00:00.001+08:00| root.a.sg1.d2| null| 2.1|
+-----------------------------------+--------------------+----------+----------+
Total line number = 2
It costs 0.007s
IoTDB> select * from root.a.sg1 where time=1 and s1=2.023 group by device;
Msg: Fail to execute select * from root.a.sg1 where time=1 and s1=2.023 group
by device after reconnecting. please check server status
It costs 0.028s
Server-side exception:
2020-02-02 00:08:46,701 [pool-3-IoTDB-JDBC-Client-thread-1] ERROR
org.apache.thrift.server.TThreadPoolServer$WorkerProcess:297 - Error occurred
during processing of message.2020-02-02 00:08:46,701
[pool-3-IoTDB-JDBC-Client-thread-1] ERROR
org.apache.thrift.server.TThreadPoolServer$WorkerProcess:297 - Error occurred
during processing of message.java.lang.IndexOutOfBoundsException: Index 0 out
of bounds for length 0 at
java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at
java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) at
java.base/java.util.Objects.checkIndex(Objects.java:372) at
java.base/java.util.ArrayList.get(ArrayList.java:458) at
org.apache.iotdb.db.qp.strategy.optimizer.RemoveNotOptimizer.removeNot(RemoveNotOptimizer.java:60)
at
org.apache.iotdb.db.qp.strategy.optimizer.RemoveNotOptimizer.optimize(RemoveNotOptimizer.java:47)
at
org.apache.iotdb.db.qp.QueryProcessor.optimizeSFWOperator(QueryProcessor.java:158)
at
org.apache.iotdb.db.qp.QueryProcessor.logicalOptimize(QueryProcessor.java:136)
at
org.apache.iotdb.db.qp.QueryProcessor.parseSQLToPhysicalPlan(QueryProcessor.java:71)
at
org.apache.iotdb.db.service.TSServiceImpl.executeStatement(TSServiceImpl.java:632)
at
org.apache.iotdb.service.rpc.thrift.TSIService$Processor$executeStatement.getResult(TSIService.java:1465)
at
org.apache.iotdb.service.rpc.thrift.TSIService$Processor$executeStatement.getResult(TSIService.java:1450)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) at
org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
See more SQLs and the following bug has no relation with above modifications:
# The following is correct:
IoTDB> select * from root.a.sg1 where time=1 and d1.s1=2.023 group by device;
+-----------------------------------+--------------------+----------+----------+
| Time| Device| s1| s2|
+-----------------------------------+--------------------+----------+----------+
| 1970-01-01T08:00:00.001+08:00| root.a.sg1.d1| 2.023| null|
| 1970-01-01T08:00:00.001+08:00| root.a.sg1.d2| null| 2.1|
+-----------------------------------+--------------------+----------+----------+
Total line number = 2
It costs 0.009s
# The following two SQLs results are incorrect. It looks like they ared
considered as d1.s1=2.023 and d2.s1=2.023
IoTDB> select * from root.a.sg1.* where time=1 and s1=2.023 group by device;
+-----------------------------------+--------------------+----------+----------+
| Time| Device| s1| s2|
+-----------------------------------+--------------------+----------+----------+
Total line number = 0
It costs 0.009s
IoTDB> select * from root.a.sg1 where time=1 and *.s1=2.023 group by device;
+-----------------------------------+--------------------+----------+----------+
| Time| Device| s1| s2|
+-----------------------------------+--------------------+----------+----------+
Total line number = 0
It costs 0.003s
> Support query on time series which are not created
> --------------------------------------------------
>
> Key: IOTDB-447
> URL: https://issues.apache.org/jira/browse/IOTDB-447
> Project: Apache IoTDB
> Issue Type: Bug
> Components: Core/Engine
> Affects Versions: 0.9.1
> Reporter: Xiangdong Huang
> Priority: Major
> Attachments: image-2020-02-01-21-21-04-037.png, keepQuery.patch
>
>
> Hi,
> I occur a new case, which is also common I think.
> As we have supported auto-creating time series, users may give up creating
> time series manually (like me!). Then the following scenario occurs:
> 1. I know I have some meteorological stations that can collect the
> temperature, press etc..
> 2. But, they may be not sent to the server in one packet. Therefore, I have
> to write codes like:
>
> {code:java}
> // code placeholder
> if ( temperature != null ){
> schema.add("temperature");
> values.add(temperature + "");
> }
> if ( press != null ){
> schema.add("press");
> values.add(press + "");
> }
> if ( windSpeed10min != null ){//10分钟风速
> schema.add("windSpeed10min");
> values.add(windSpeed10min + "");
> }
> session.insert(devicePath, observationTimeLong, schema, values);
> {code}
> Remember that I do not know when these stations will send the measurements to
> the server. For example, maybe some stations have no anemoscopes, maybe the
> anemoscopes of some stations are broken before I deploy my application.
> However, I do not know about that when I develop my query applications.
> 3. So, when I query data, I will write statements like:
> SELECT temperature, press,windDirection2min,windSpeed10min,... FROM
> root.national.*.5.*.*.* WHERE time = '2020-01-19T04:00:00.000+08:00'
>
> Ok, now suppose there is one station that never sent "windSpeed10min" to the
> server because of mentioned reasons in 2, then the query will fail because:
> Msg: Statement format is not right: Path:
> "root.national.*.5.*.*.*.*.windSpeed10min" doesn't correspond to any known
> time series.
>
> What can I do? I can not query measurements and stations one by one...
>
> If we do not allow auto-creating time series, the above scenario does not
> happen because we will create ALL POSSIBLE time series at first. But, we know
> it is not good, and that is one of the reasons that we support the
> auto-creating time series.
>
> So, now that we support auto-creating time series, it is better to fill the
> result of not existed time series as NULL rather than return an error message
> to block all queries.
>
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)