apache / apache/iotdb

[Bug] In version 1.3.3 of IoTDB, The time series function TIME_DIFFERENCE returns an index out of bounds error.

Aperta
#14,522 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
6.4k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
115

Descrizione

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

version 1.3.3 (Build: ad95a7e)

### Describe the bug and provide the minimal reproduce step

```
DROP DATABASE root.db0.t1
CREATE DATABASE root.db0.t1

CREATE TIMESERIES root.db0.t1.c0 WITH datatype=INT32;
INSERT INTO root.db0.t1(timestamp, c0) VALUES (1641024000000, 0), (1641024005000, 1);

# query 1
SELECT TIME_DIFFERENCE(c0) FROM root.db0.t1 WHERE c0 < 0;

# query 2
SELECT TIME_DIFFERENCE(c0) FROM root.db0.t1 WHERE time != time;
```

### What did you expect to see?

The expected result set for Query 1 is: **empty set**

The expected result set for Query 2 is: **empty set**

### What did you see instead?

The actual result set returned by Query 1 is: **empty set**

The actual result set returned by Query 2 is: **Msg: org.apache.iotdb.jdbc.IoTDBSQLException: 301: Index 1 out of bounds for length 1**

### Anything else?

Dear IoTDB team, In the above queries, both Query 1 and Query 2 are unable to retrieve any data, so they both perform the `TIME_DIFFERENCE` operation on empty sets. However, Query 2 triggers an index out of bounds error during execution. This should be considered a crash error.

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia eseguendo la riproduzione minima con IoDB 1.3.3 e confrontando Query 1 e Query 2. Traccia il percorso di esecuzione di TIME_DIFFERENCE per il risultato vuoto prodotto da Query 2; l’attività è completata quando entrambe le query restituiscono un insieme vuoto senza un’eccezione di indice fuori dai limiti. Nell’issue non sono indicati alcun file sorgente né alcun test esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, sql
Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.