ibis-project / ibis

the portable Python dataframe library
https://ibis-project.org
Apache License 2.0
4.63k stars 564 forks source link

feat: ibis mssql backend, add parameter for table_option #9436

Open ruiyang2015 opened 3 weeks ago

ruiyang2015 commented 3 weeks ago

Is your feature request related to a problem?

for mssql backend, the current signature does not allow additional table options for ibis.mssql.create_table, for sql server/synapse, we will need additional table options when creating a table. like cluster data compression etc. the syntax is like this: create table foo (columns_def..) with ( <table options>)

What is the motivation behind your request?

so we can create a table with additional table level options, and those can not be done with an alter table command.

Describe the solution you'd like

for ibis.mssql.create_table(...., table_options: str) to allow additional table options during create table.

What version of ibis are you running?

9.1.0

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

Synapse

Code of Conduct

gforsyth commented 3 weeks ago

Hey @ruiyang2015 -- we currently support similar extensions for a few of our backends that have more complex table creation options.

In the meantime, you can certainly work around this by using raw_sql or a standalone dbapi connection to first create the table before interacting with it via Ibis.

ruiyang2015 commented 3 weeks ago

Hey @ruiyang2015 -- we currently support similar extensions for a few of our backends that have more complex table creation options.

In the meantime, you can certainly work around this by using raw_sql or a standalone dbapi connection to first create the table before interacting with it via Ibis.

yes, but that require a lot of extra work that ibis is trying to help us avoid, like we want to create a table from pandas.df or pyarrow table, we do not need to deal with hand crafted column schemas. alternatively, wondering if you can have create_table function that do not execute the code, but return the create sql, so we can append additional table options to it, that will be helpful too in here.