elixir-explorer / adbc

Apache Arrow ADBC bindings for Elixir
https://arrow.apache.org/adbc/
Apache License 2.0
50 stars 16 forks source link

Query with params don't work with Snowflake #38

Closed sezaru closed 1 year ago

sezaru commented 1 year ago

I'm trying to run the following query:

Adbc.Connection.query(attom_conn, "select * from RECORDER where ATTOM_ID = '?1'", ["178868996"])

This will give me the following error:

{:error,
 #Adbc.Error<
   message: "[Snowflake] executing non-bulk ingest with bound params not yet implemented",
   vendor_code: 0,
   ...
 >}

If I remove the params and run the query as a single string like this:

Adbc.Connection.query(attom_conn, "select * from RECORDER where ATTOM_ID = '178868996'", [])

Then it works fine

josevalim commented 1 year ago

I am afraid this one will need to be reported upstream on ADBC.

sezaru commented 1 year ago

Found this issue already open there: https://github.com/apache/arrow-adbc/issues/1144

Kinda a bummer, makes working with snowflake very limited, hopefully that will be solved soon.

josevalim commented 1 year ago

Closing this one then, I have subscribed to that issue.

Are you by any chance using Livebook? If so, maybe we should make it so our queries do not use parameters?

sezaru commented 1 year ago

@josevalim Yes, I'm using it with Livebook, I get the same error there, but posted here since it was clear that it was an error in this layer not in livebook itself.

Actually I was about to suggest the same thing, can't we process the query before in Explorer before sending it to Adbc? That way we would always send a string and it should just work.

josevalim commented 1 year ago

@sezaru I would do that in Livebook itself. Although escaping will certainly be an issue. :(