After Tdengine is upgraded from 3.1.1.0 to 3.3.3.0, an error is reported in the original correct query SQL statement. Parser internal error
Open
Nobody has claimed this yet.
bug
- Dominant language
- C
- Stars
- 25.1k
- Forks
- 5k
- Avg merge
- 4d 59m
- Merged PRs (30d)
- 7
Description
Bug Description
After Tdengine is upgraded from 3.1.1.0 to 3.3.3.0, an error is reported in the original correct query SQL statement. The SQL syntax is correct,The error message is displayed: Parser internal error
To Reproduce
- super table:
CREATE STABLEenergy_data(collect_date_timeTIMESTAMP ENCODE 'delta-i' COMPRESS 'lz4' LEVEL 'medium',collect_valueDOUBLE ENCODE 'delta-d' COMPRESS 'lz4' LEVEL 'medium',e_valueDOUBLE ENCODE 'delta-d' COMPRESS 'lz4' LEVEL 'medium',repair_numberSMALLINT ENCODE 'simple8b' COMPRESS 'lz4' LEVEL 'medium',is_checkBOOL ENCODE 'bit-packing' COMPRESS 'lz4' LEVEL 'medium',is_supplementBOOL ENCODE 'bit-packing' COMPRESS 'lz4' LEVEL 'medium',tsBIGINT ENCODE 'simple8b' COMPRESS 'lz4' LEVEL 'medium') TAGS (device_idNCHAR(36),project_idNCHAR(36)) - An error is reported in the SQL statement:
select groupId,start_time,end_time,device_id,sum(value) asvaluefrom( select 1297874473749565440 as groupId,_wstart as start_time,_wend as end_time,device_id, sum( CASE WHEN ts>=0 and ts < 12600000 THEN e_value * '2.0000000000' WHEN ts>=12600000 and ts < 41400000 THEN e_value * '3.0000000000' WHEN ts>=41400000 and ts < 57540000 THEN e_value * '4.0000000000' WHEN ts>=57600000 and ts < 68400000 THEN e_value * '1.0000000000' WHEN ts>=68400000 and ts < 86340000 THEN e_value * '2.0000000000' ELSE 0 end) asvaluefrom taiot.energy_data where (collect_date_time >= 1727712000000 and collect_date_time < 1730390400000 ) and e_value is not null and project_id = '1295391763945324544' and device_id in ('szsb1') partition by device_id interval(1n) ) as t1 group by groupId,start_time,end_time,device_id;
Expected Behavior
Correct query
Environment (please complete the following information):
- TDengine Version 3.3.3.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files, tests, or parser entry points are named. Start by running the supplied SQL against TDengine 3.1.1.0 and 3.3.3.0, then trace where 3.3.3.0 emits "Parser internal error"; done means the query is accepted as expected or the regression is covered by a reproducible test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100