ibis icon indicating copy to clipboard operation
ibis copied to clipboard

bug: export to pyarrow does not works with Fabric DWH

Open djouallah opened this issue 1 year ago • 4 comments

What happened?

when I run this code

con.sql(sql, dialect="mssql").to_pyarrow(),

I get this error

DMV (Dynamic Management View) 'dm_exec_describe_first_result_set' is not supported.

What version of ibis are you using?

9.5

What backend(s) are you using, if any?

mssql

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

djouallah avatar Sep 24 '24 06:09 djouallah

Thanks for the issue!

Not sure if I'd categorize this as a bug. We don't test against Fabric and the various MS SQLs seem to be wildly incompatible with each other.

The reason we're using dm_exec_describe_first_result_set is to compute the column names and types of arbitrary SELECT statements. Is there a way to do that that works in both Fabric and vanilla MS SQL? If so, then we can probably implement it without having an explicit Fabric backend (though I imagine eventually we'll want that).

cpcloud avatar Sep 24 '24 10:09 cpcloud

Thanks for the issue!

Not sure if I'd categorize this as a bug. We don't test against Fabric and the various MS SQLs seem to be wildly incompatible with each other.

The reason we're using dm_exec_describe_first_result_set is to compute the column names and types of arbitrary SELECT statement. Is there a way to do that that works in both Fabric and vanilla MS SQL? If so, then we can probably implement it without having an explicit Fabric backend (though I imagine eventually we'll want that).

to be honest, I know, it is an upstream issue, I add it just as a bookmark for the lack of a better word

djouallah avatar Sep 24 '24 11:09 djouallah

The previous method that we used (https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-describe-first-result-set-transact-sql) would work on both vanilla MSSQL and Fabric, according to their docs.

Unfortunately, using sp_describe_first_result_set with a case-sensitive collation apparently causes DLL loading issues because... no one knows?

gforsyth avatar Sep 24 '24 12:09 gforsyth

@djouallah do you know people on the Fabric (or Synapse) team(s) that we could reach out to about discussing proper Azure data backend(s) to Ibis? it would be great to at least enumerate all the work we need and have a point of contact for the key differences between what we already support (MSSQL)

lostmygithubaccount avatar Sep 24 '24 13:09 lostmygithubaccount

This requires some support on the Fabric side. Would be great to get a conversation going. @djouallah friendly ping!

cpcloud avatar Nov 02 '24 12:11 cpcloud