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

Union Query with Join throws error #17494

Open
pjain1 opened this issue Nov 20, 2024 · 0 comments
Open

Union Query with Join throws error #17494

pjain1 opened this issue Nov 20, 2024 · 0 comments

Comments

@pjain1
Copy link
Member

pjain1 commented Nov 20, 2024

Have been trying to use a right join query with unioned datasource to achieve sort of null filling since timeseries have limited support for returning empty buckets (like it just fills missing buckets within segment's actual min and max time not the query min and max times) but it fails.

Affected Version

29.0.1

Description

SELECT "t2"."hour", "t1"."Count" FROM (
  (SELECT TIME_FLOOR("__time", 'PT1H') AS "hour",
    COUNT(*) AS "Count"
    FROM "inline_data_day" GROUP BY 1) "t1"
  RIGHT JOIN (
    SELECT CAST('2023-10-10T00:00:00.000Z' as TIMESTAMP) as "hour"
    UNION ALL 
    SELECT CAST('2023-10-10T01:00:00.000Z' AS TIMESTAMP) as "hour"
    UNION ALL 
    SELECT CAST('2023-10-10T02:00:00.000Z' AS TIMESTAMP) as "hour"
  ) "t2" 
  ON "t1"."hour"="t2"."hour"
)

This fails with

Query could not be planned. A possible reason is [SQL requires union with input of a datasource type that is not supported. Union operation is only supported between regular tables. ]

inline_data_day is just

__time	                        v	count
2023-10-10T00:00:00.000Z	a	1
2023-10-10T02:00:00.000Z	b	2
2023-10-11T00:00:00.000Z	a	1
2023-10-11T02:00:00.000Z	b	2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant