Skip to content

GUI query with a self join won't work #188

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

Open
paoliniluis opened this issue Aug 14, 2023 · 1 comment
Open

GUI query with a self join won't work #188

paoliniluis opened this issue Aug 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@paoliniluis
Copy link

paoliniluis commented Aug 14, 2023

Seems that doing a self join will build a query that won't work in Clickhouse:

image

sql:
image

Code: 352. DB::Exception: Ambiguous column 'ecommerce.ecommerce_sanitized.event_time': While processing ecommerce.ecommerce_sanitized.event_time AS event_time. (AMBIGUOUS_COLUMN_NAME) (version 23.7.4.5 (official build))
, server ClickHouseNode [uri=http://clickhouse:8123/ecommerce, options={use_server_time_zone_for_dates=true,use_no_proxy=false,product_name=metabase/1.2.1}]@581467449

But in postgres it will work:
image


SELECT "public"."people"."id" AS "id", "public"."people"."address" AS "address", "public"."people"."email" AS "email", "public"."people"."password" AS "password", "public"."people"."name" AS "name", "public"."people"."city" AS "city", "public"."people"."longitude" AS "longitude", "public"."people"."state" AS "state", "public"."people"."source" AS "source", "public"."people"."birth_date" AS "birth_date", "public"."people"."zip" AS "zip", "public"."people"."latitude" AS "latitude", "public"."people"."created_at" AS "created_at", "People"."id" AS "People__id", "People"."address" AS "People__address", "People"."email" AS "People__email", "People"."password" AS "People__password", "People"."name" AS "People__name", "People"."city" AS "People__city", "People"."longitude" AS "People__longitude", "People"."state" AS "People__state", "People"."source" AS "People__source", "People"."birth_date" AS "People__birth_date", "People"."zip" AS "People__zip", "People"."latitude" AS "People__latitude", "People"."created_at" AS "People__created_at"
FROM "public"."people"
LEFT JOIN "public"."people" AS "People" ON "public"."people"."id" = "People"."id"
LIMIT 1048575

EDIT: using 47-RC3 and latest clickhouse driver

@paoliniluis paoliniluis added the bug Something isn't working label Aug 14, 2023
@slvrtrn slvrtrn self-assigned this Aug 14, 2023
@camerondavison
Copy link

how much work is this to fix given this bug has been around so long? we run salesforce reports in metabase, and it would help if we could join the "Account.ParentId" to the same table "Account.Id" .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants