Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corner case in AST parser affects toTimeSeries serialization #648

Closed
Slach opened this issue Oct 24, 2024 · 0 comments · Fixed by #650
Closed

Corner case in AST parser affects toTimeSeries serialization #648

Slach opened this issue Oct 24, 2024 · 0 comments · Fixed by #650
Assignees
Milestone

Comments

@Slach
Copy link
Collaborator

Slach commented Oct 24, 2024

Query Example

WITH
  /* splitByChar('(', user_metadata_map['rp_prescreenStep'])[1] as prescreen, */
  user_metadata_map['rocketStage'] AS stage,
  stage AS keys
SELECT
  (intDiv(toUInt32(_time), 3600) * 3600) * 1000 as t,
  keys,
  sum(alloc_cost) as cost
FROM default.test_barchart
WHERE
  cluster NOT LIKE '%-sleep'
  AND cluster NOT LIKE '%_test'
  AND hpcod_resource_name != 'INTERACTIVE'
GROUP BY keys, t
ORDER BY keys, t

root reason is

  /* splitByChar('(', user_metadata_map['rp_prescreenStep'])[1] as prescreen, */
                ^^^^ brackets here pass corner case to AST parser (!isClousered)

whole query parsed as one single WITH,
miss parse SELECT, FROM, ORDER BY, GROUP BY
this is not affect query execution pipeline
but affect query result serialization to grafana timeSeries format,
replacing ( to any other char, resolves issue

@Slach Slach added this to the 3.4.0 milestone Oct 24, 2024
@Slach Slach self-assigned this Oct 24, 2024
Slach added a commit that referenced this issue Oct 24, 2024
@Slach Slach modified the milestones: 3.4.0, 3.2.4 Oct 27, 2024
Slach added a commit that referenced this issue Oct 27, 2024
Slach added a commit that referenced this issue Oct 27, 2024
Slach added a commit that referenced this issue Oct 27, 2024
Signed-off-by: Eugene Klimov <[email protected]>
Slach added a commit that referenced this issue Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant