ClickHouse / metabase-clickhouse-driver

ClickHouse database driver for the Metabase business intelligence front-end
Apache License 2.0
461 stars 84 forks source link

Converting question to SQL generates non-working code (extra spaces in db, table, field names) #195

Closed sergem155 closed 7 months ago

sergem155 commented 9 months ago

Describe the bug

Converting question to SQL generates non-working code (extra spaces in db, table, field names). Sample database (included with Metabase) query does not exhibit this issue

Steps to reproduce

  1. run a new question, e.g. count of rows
  2. convert to SQL
  3. click execute

Expected behaviour

same result as in UI query editor

Error log

generated query:
SELECT
  COUNT(*) AS ` count `
FROM
  ` vd `.` Talk Party `

error message:

Code: 81. DB::Exception: Database ` vd ` doesn't exist. (UNKNOWN_DATABASE) (version 23.4.2.11 (official build)) , server ClickHouseNode [uri=http://localhost:8123/vd, options={use_server_time_zone_for_dates=true,use_no_proxy=false,product_name=metabase/1.2.1}]@-156336438]

Configuration

Environment

ClickHouse server

slvrtrn commented 9 months ago

Currently working on it (I plan to include it in #194). Thanks for the report.

slvrtrn commented 9 months ago

@sergem155, unfortunately, this is a bug in Metabase itself: https://github.com/metabase/metabase/issues/34235

Gerrit-K commented 7 months ago

@slvrtrn the bug you linked is closed with the milestone 0.47.7. I've just upgraded to 0.47.8, but I'm still seeing these spaces. Is there perhaps an additional issue with the clickhouse driver or should I request to reopen the upstream issue?

slvrtrn commented 7 months ago

@Gerrit-K, I thought it would be released as part of 0.48.x (for which I created a branch already: https://github.com/ClickHouse/metabase-clickhouse-driver/pull/204). I will make a release for 0.47.x that includes part of these changes, then :+1:

Gerrit-K commented 7 months ago

@slvrtrn Ah, I see. That would be awesome, thank you!

slvrtrn commented 7 months ago

@Gerrit-K @sergem155, fixed in 1.2.4.