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
{{ message }}
Repository navigation
A prepared query can't write a table it names with its schema (public.a) #322
🌀 Claude: A prepared query that names its table with the schema can't write it.
PreparedQuery decides which Datasets a call may write from the names in the query's plan. A plan prints a table as the query wrote it, so FROM public.a reads public.a, which isn't the key a the Dataset is registered under:
importnumpyasnp, xarrayasxrfromxarray_sqlimportContextctx=Context()
ctx.from_dataset("a", xr.Dataset({"v": ("i", np.arange(3.0))}, coords={"i": np.arange(3)}))
q=ctx.prepare("SELECT v FROM public.a ORDER BY i")
q(a=xr.Dataset({"v": ("i", np.array([7.0, 8, 9]))}, coords={"i": np.arange(3)}))
ValueError: the query reads no Dataset registered as 'a' when it was prepared
Reproduced on main at 447791a (0.7.1), with DataFusion 55.0.0. FROM datafusion.public.a fails the same way. It errors, so it never gives a wrong answer.
The 0.8.0 hooks PR fixes it: the public Context.tables_read leaves out the default catalog and schema, as replacements already does since 0.7.1, and PreparedQuery uses it.
Activity
Release 0.8.0 (#327)
Make Context's records of its tables and functions public (xqlsystems…