49 questions
0 votes
0 answers
35 views
Can ibis-frame trans expr to hive SQL with lateral view explode?
When I use ibis-framework to generate SQL with pyspark dialect, I got this SQL: SELECT `t2`.`did`, `t2`.`location_timestamp`, EXPLODE(FROM_JSON(`t2`.`devices`, 'Array<String>')) AS `...
1 vote
1 answer
143 views
Access other columns in ibis across
Is there any way to access other columns inside an ibis aggregate statement using across? I created a bunch of boolean columns using mutate across, but I want to sum another column (df. ...
0 votes
1 answer
136 views
How to Filter Rows of a Table Using a List of Primary Keys in Ibis Framework
Problem: I need to filter rows per ID. But I'd like to make it more general such that client user can provide more than 1 ID. I decided to write my code this way using the concept of %in% on SQL ...
0 votes
1 answer
476 views
Persisting changes to database backend using ibis-framework
I am experimenting with the Ibis framework: it seems a great tool to work on tables that already contain data that I need to join, filter, aggregate, etc. However, I do not find how to persist changes ...
0 votes
0 answers
61 views
Is there any migration mechanism for altering table schema in Ibis?
We are planning to shift from infi.clickhouse to ibis, so I was wondering, does ibis support the migration of old schema to new like infi.clickhouse? If not, then what could be the solution to this? ...
0 votes
1 answer
293 views
Mutate a column in Ibis when column name has spaces
Given a dataframe that has a column with a space: ibis.memtable({ 'colname with space': ['a', 'b', 'c'] }) I want to mutate this column. How do I reference it in the .mutate method? One way is ...
4 votes
1 answer
109 views
AttributeError: module 'ibis.selectors' has no attribute 'index'
I'm trying to select columns by index just like this reference from the ibis docs: import ibis import ibis.selectors as s spotify = ibis.duckdb.connect() spotify.read_csv("hf://datasets/...
0 votes
1 answer
442 views
Ibis to Sql using ibis.tosql()
I want Query to be in this format SELECT u.name, nicknames AS nickname FROM `india.nvidia.user_table` u, UNNEST(nicknames) AS nicknames WHERE u.l is true my py file import ibis ...
1 vote
1 answer
299 views
Use Ibis to return aggregates of every numeric column in a table
I want to use Ibis to return the mean and standard deviation of each floating point numeric column in a table. How do I do that?
2 votes
1 answer
399 views
Use Ibis to filter table to row with largest value in each group
I have a table like this: ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓ ┃ country ┃ city ┃ population ┃ ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━┩ │ string │ string │ int64 ...
0 votes
1 answer
318 views
How to set pandas or duckdb backend in ibis memtable?
I have a function like this: import ibis def my_function(df): t = ibis.memtable(df) t = t.mutate(ibis._['a'] + 1) return to.to_arrow() My question is - if I pass it a pandas dataframe, ...
1 vote
1 answer
277 views
Use ibis-framework to compute shifts (lags) in dataframe
Say I want to do the following in Polars: df.with_columns( a_1 = pl.col('a').shift(1), a_2 = pl.col('a').shift(2), b_1 = pl.col('b').shift(1), b_2 = pl.col('b').shift(2), ) Say, ...
0 votes
1 answer
222 views
ibis: select map on array value works with table object but not with the underscore operation
for a table with a list field i'm trying to call map import ibis from ibis import _ t = ibis.memtable({ 'i': [1,2,3], 'x': [[1,2],[3,5],[6,7] ] }) using the table object works: t.select(t....
1 vote
1 answer
555 views
in the python ibis framework, Is there a way to cumsum over a order by column
I have a very large complex ibis script with a portion calculating some columns. at the end, I need to ibis.to_sql(t) to get a sql statement for my python. So I can't use pandas lets say i have this ...
2 votes
1 answer
96 views
Is there an `ANY` or `ANY_VALUE` expression in Ibis that will let me compare a value from a set of values returned by a subquery?
Let t = ibis.memtable({'col0': [-2, -5, -1, 0, 1, 8, 7], 'col1': [0, -2, 4, 5, 6, 8, 7]}). I want to find all of the rows where col0 is any value in col1. In SQL, I might do: SELECT * FROM t WHERE ...