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

Unconditiional join query with SQL which was working on 25.0.0 not working on 29.0.0 it must have broken somewhere in between #16179

Open
stamboli opened this issue Mar 20, 2024 · 0 comments

Comments

@stamboli
Copy link

Affected Version

29.0.0

Description

SampleSaleData.csv
SampleSaleData.json
environment.txt : Environment file attaching here as txt as no extension file was not allowed

  • Steps to reproduce the problem
  • Upload given csv file, for reference even environment file and durid load spec is provided
  • Run below unconditional join (simplified to best that could reproduce issue) query either run with cross join (same issue if left join with dummy join condition as '10'='10' used) to work with 25.0.0 but stopped working with 29.0.0

SELECT
"numr"."Brand Name" AS "Brand Name",
"numr"."Units" AS "Brand Units",
"denom"."Units" AS "Total Units"
FROM
(
SELECT
"SampleSaleData"."Brand Name" AS "Brand Name",
SUM("SampleSaleData"."Units") AS "Units"
FROM
SampleSaleData "SampleSaleData"
GROUP BY
"SampleSaleData"."Brand Name"
) "numr"
CROSS JOIN (
SELECT
SUM("SampleSaleData"."Units") AS "Units"
FROM
SampleSaleData "SampleSaleData"
GROUP BY
TIME_PARSE('2022-01-05T00:00:00.000Z')
) "denom"
GROUP BY
"numr"."Brand Name",
"numr"."Units",
"denom"."Units"
ORDER BY
"Brand Name" ASC

  • The error message or stack traces encountered. Providing more context, such as nearby log messages or even entire logs, can be helpful.
    Error: INVALID_INPUT (ADMIN)
    Query could not be planned. A possible reason is [SQL query requires ordering a table by non-time column [[Brand Name]], which is not supported.]

  • Any debugging that you have already done
    This works when there are valid condition for join, this gives issue only when unconditional join for instance below slightly modified query with valid join condition across two queries works fine

SELECT
"numr"."Country" AS "Country",
"numr"."Brand Name" AS "Brand Name",
"numr"."Units" AS "Brand Units",
"denom"."Units" AS "Total Units"
FROM
(
SELECT
"SampleSaleData"."Country" AS "Country",
"SampleSaleData"."Brand Name" AS "Brand Name",
SUM("SampleSaleData"."Units") AS "Units"
FROM
SampleSaleData "SampleSaleData"
GROUP BY
"SampleSaleData"."Country",
"SampleSaleData"."Brand Name"
) "numr"
LEFT JOIN (
SELECT
"SampleSaleData"."Country" AS "Country",
SUM("SampleSaleData"."Units") AS "Units"
FROM
SampleSaleData "SampleSaleData"
GROUP BY
"SampleSaleData"."Country",
TIME_PARSE('2022-01-05T00:00:00.000Z')
) "denom" ON "numr"."Country"="denom"."Country"
GROUP BY
"numr"."Country",
"numr"."Brand Name",
"numr"."Units",
"denom"."Units"
ORDER BY
"Brand Name" ASC

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