ibis
ibis copied to clipboard
feat: SQL arbitrary functions without code modification
For tables, you can do client.sql(SQL_STRING) to get an ibis object for an abitrary sql string. If something like this were possible for columns inside of tables, users could use more of the functionality of their particular backend before that functionality is actually built into ibis.
I can imagine that as UDFs for sql backends, like for pandas in https://github.com/ibis-project/ibis/pull/1277
Translator helpers like sa.func.<name> could be handy too.
For example:
from ibis.func import from_base64
t = ibis.table(dict(a="binary"))
from_base64(t.a, output_type="string")
This is possible with .sql:
t.alias('my_table').sql("SELECT GREAT_FUNCTION(x) FROM my_table")