apache / apache/iotdb

[v0.12.2] Error when using aggregate query and nested expressions

Aperta
#4,311 3 commenti 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

**Describe the bug**

When combining an aggregate query with nested expressions, I get an error - e.g.:

```
Msg: 401: Error occurred while parsing SQL to physical plan: line 1:39 mismatched input '+' expecting {'*', '.', ')'}
```

Or:

```
Msg: 401: Error occurred while parsing SQL to physical plan: line 1:7 extraneous input '(' expecting {CREATE, INSERT, UPDATE, DELETE, SELECT, SHOW, GRANT, INTO, SET, WHERE, FROM, TO, BY, DEVICE, CONFIGURATION, DESCRIBE, SLIMIT, LIMIT, UNLINK, OFFSET, SOFFSET, FILL, LINEAR, PREVIOUS, PREVIOUSUNTILLAST, METADATA, TIMESERIES, TIMESTAMP, PROPERTY, WITH, DATATYPE, COMPRESSOR, STORAGE, GROUP, LABEL, INT32, INT64, FLOAT, DOUBLE, BOOLEAN, TEXT, PLAIN, PLAIN_DICTIONARY, RLE, DIFF, TS_2DIFF, GORILLA, REGULAR, ADD, UPSERT, VALUES, NOW, LINK, INDEX, USING, TRACING, ON, OFF, SYSTEM, READONLY, WRITABLE, DROP, MERGE, LIST, USER, PRIVILEGES, ROLE, ALL, OF, ALTER, PASSWORD, REVOKE, LOAD, WATERMARK_EMBEDDING, UNSET, TTL, FLUSH, TASK, INFO, VERSION, REMOVE, MOVE, CHILD, PATHS, DEVICES, COUNT, NODES, LEVEL, MIN_TIME, MAX_TIME, MIN_VALUE, MAX_VALUE, AVG, FIRST_VALUE, SUM, LAST_VALUE, LAST, DISABLE, ALIGN, COMPRESSION, TIME, ATTRIBUTES, TAGS, RENAME, GLOBAL, FULL, CLEAR, CACHE, TRUE, FALSE, UNCOMPRESSED, SNAPPY, GZIP, LZ4, PARTITION, SNAPSHOT, FOR, SCHEMA, DESC, ASC, TOP, '*', OPERATOR_IN, '-', '[', INT, EXPONENT, DURATION, DATETIME, ID, DOUBLE_QUOTE_STRING_LITERAL, SINGLE_QUOTE_STRING_LITERAL}
```

**To Reproduce**
Steps to reproduce the behavior:
1. Add some timelines with data
2. Run a query combining an aggregate query with nested expressions
4. See error

**Expected behavior**

A result should be given containing the calculated values.

**Desktop (please complete the following information):**
- OS: Linux
- Browser n\a
- Version 0.12.2

**Additional context**

I have more than 3 time series with data from `2021-10-18` until today where I ran the following queries:

```
SELECT avg(mp3.1_0_31_7_0.temperature) + avg(mp4.1_0_31_7_0.temperature), avg(mp5.1_0_31_7_0.temperature) from root.test WHERE (time > 2021-11-01T00:05:00.000 and time < 2021-11-01T00:06:00.000) group by ([2021-11-01T00:05:00.000, 2021-11-01T00:06:10.000),1s)

SELECT (avg(mp3.1_0_31_7_0.temperature) + avg(mp4.1_0_31_7_0.temperature)), avg(mp5.1_0_31_7_0.temperature) from root.test WHERE (time > 2021-11-01T00:05:00.000 and time < 2021-11-01T00:06:00.000) group by ([2021-11-01T00:05:00.000, 2021-11-01T00:06:10.000),1s)
```

If there's anything I missed, please let me know. I want to use these queries as continuous query. If there's something I should keep in mind for that, I would appreciate if you'd let me know.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo le due query di aggregazione su IoTDB v0.12.2 e traccia l’errore di parsing SQL-to-physical-plan. Il lavoro è completato quando entrambe le query, comprese le espressioni annidate come AVG(...) + AVG(...), restituiscono i valori calcolati invece di errori del parser.

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
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.