You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a quite complex view in clickhouse that looks like this
CREATEVIEWIF NOT EXISTS mau_final_param asSELECT DISTINCTON (m.date,m.app_id)
m.dateASdate,
m.app_idAS app_id,
COALESCE(m.total, 0) AS mau,
COALESCE(l.get, 0) AS get,
COALESCE(l.fail, 0) AS fail,
COALESCE(l.install, 0) AS install,
COALESCE(l.uninstall, 0) AS uninstall,
COALESCE(l.bandwidth, 0) AS bandwidth,
COALESCE(s.storage_added, 0) AS storage_added,
COALESCE(s.storage_deleted, 0) AS storage_deleted
FROM (SELECTresult.1date, uniqMerge(arrayJoin(result.2)) total, app_id
FROM (
SELECT
groupArray((date, value)) data,
arrayMap(
(x, index) -> (x.1, arrayMap(y ->y.2, arraySlice(data, index))),
data,
arrayEnumerate(data)) result_as_array,
arrayJoin(result_as_array) result, app_id
FROM (
SELECT app_id, date, total value
FROM (
/* emulate the original data */SELECT app_id, total, datefrom mau where hasAll({app_list:Array(String)}, [app_id])
ORDER BYdatedesc, app_id)
) group by app_id
) group by app_id, dateorder bydatedesc) m
LEFT JOIN logs_daily l ONm.date=l.dateANDm.app_id=l.app_idLEFT JOIN app_storage_daily s ONl.date=s.dateANDl.app_id=s.app_idgroup bym.app_id, m.date, l.get, l.install, l.uninstall, l.bandwidth, l.fail, s.storage_added, s.storage_deleted, m.total;
This view uses parametrized query, in clickhouse I can use this view like this:
Now, I would like to do the same in supabase with clickhouse fdw
As such, I created a foreign table:
create foreign table clickhouse_app_usage_parm (
datedate,
app_id text,
bandwidth bigint,
mau bigint,
get bigint,
fail bigint,
uninstall bigint,
install bigint,
storage_added bigint,
storage_deleted bigint,
_app_list text[]
)
server clickhouse_server
options (
table '(select * from mau_final_param(app_list=${_app_list}))'
);
and then I tried to fetch this view like this:
DO $$
DECLARE app_ids text[];
BEGINselect array_agg(app_id) INTO app_ids FROM apps;
select*from clickhouse_app_usage_parm where _app_list=app_ids;
END $$;
Unfortunately this did not work and I got the following error:
Thanks for reporting this issue. The array data type hasn't been supported yet, so it cannot be passed as parameter to ClickHouse FDW at this moment. The full list of supported types can be found in this docs.
kamyshdm
pushed a commit
to dymium-io/supabase-wrappers
that referenced
this issue
Jun 17, 2024
Bug report
Describe the bug
I have a quite complex view in clickhouse that looks like this
This view uses parametrized query, in clickhouse I can use this view like this:
Now, I would like to do the same in supabase with clickhouse fdw
As such, I created a foreign table:
and then I tried to fetch this view like this:
Unfortunately this did not work and I got the following error:
To Reproduce
Please see above
Expected behavior
I would expect the parametrized query to work one way or the other. And the
unsupported operator expression in qual
to be fixedScreenshots
If applicable, add screenshots to help explain your problem.
System information
The text was updated successfully, but these errors were encountered: