metabase-clickhouse-driver icon indicating copy to clipboard operation
metabase-clickhouse-driver copied to clipboard

Request error when filtering by field

Open sergeymong opened this issue 4 years ago • 4 comments

Hi!, Thank you very much for your work. We have 2 types of tables, some are called through snake_case, others through dot.case. When you do a filter by dot.case table, you get this error (this is part of traceback):

Code: 47, e.displayText() = DB::Exception: Missing columns: 'replicated.backend.booking.issuing.success.date' while processing query: 'SELECT date, datetime, client_id, visit_id, agent, tag, ab_tag, token, order_number, email, account_id, phone, order_total, tickets_total, cross_total, payment_type, amount_insurance, amount_fly_sms, amount_refund, amount_coverage, amount_online_registration, amount_vip, departure_iata_code, arrival_iata_code, departure_date, return_date, passengers, adults, childs, infants, cabin_class, x_request_id, profit, bonus_use_amount, bonus_from_order_amount, marker, `segments.segment_index`, `segments.ticket_index`, `segments.gds_pnr`, `segments.airline_pnr`, `segments.part_index`, `segments.departure_code`, `segments.arrival_code`, `segments.departure_time`, `segments.arrival_time`, `segments.flight_time_mins`, `segments.operating_carrier`, `segments.marketing_carrier`, `segments.plating_carrier`, `segments.marketing_flight_number`, `segments.booking_class` FROM replicated.`backend.booking.issuing.success` WHERE (toDate(replicated.backend.booking.issuing.success.date) >= '2020-01-01') AND (toDate(replicated.backend.booking.issuing.success.date) <= '2020-01-31') LIMIT 100

You can see that the point is that there are no necessary backquotes in toDate function. Is it possible to fix this problem, please?

sergeymong avatar Mar 10 '20 13:03 sergeymong

Also has problem with Materialized View's .inner tables. Traceback:

Code: 62, e.displayText() = DB::Exception: Syntax error: failed at position 183 (line 4, col 27): ``.`inner`.`by_airline`.`search_date`) BETWEEN '2020-07-01' AND '2020-07-31'\nLIMIT

Query:

SELECT count()
FROM directions.`.inner.by_airline`
WHERE {{ search_date }}
LIMIT 100

sergeymong avatar Mar 10 '20 13:03 sergeymong

Hi @sergeymong thank you for reporting this issue. Which version are you running?

enqueue avatar Mar 13 '20 13:03 enqueue

If you are asking about the Metabase version, it is 0.34.3. Driver version: 0.7.

sergeymong avatar Mar 13 '20 13:03 sergeymong

Encountering the same issue on filtering

julienmarie avatar Apr 16 '20 07:04 julienmarie

Re-tested it with 1.2.0; both cases work fine now. Likely, this should be the case with 1.1.7 as well. Please open a new issue if the problem persists.

slvrtrn avatar Aug 03 '23 04:08 slvrtrn