Closed
Description
when the result is larger than 10 rows, it is truncated
>>> from datafusion import SessionContext
>>> import time
>>> ctx = SessionContext()
>>> ctx.sql("create table item as select i%7 i_category, i%11 i_color from (select value i from generate_series(1,10000\
00))")
No data to display
>>> t=time.time();df = ctx.sql("select i_color, count(distinct i_color) from item group by i_color");t=time.time()-t
>>> print(df)
DataFrame()
+---------+------------------------------+
| i_color | count(DISTINCT item.i_color) |
+---------+------------------------------+
| 5 | 1 |
| 1 | 1 |
| 10 | 1 |
| 9 | 1 |
| 2 | 1 |
| 4 | 1 |
| 7 | 1 |
| 3 | 1 |
| 8 | 1 |
| 6 | 1 |
+---------+------------------------------+
Data truncated.Metadata
Metadata
Assignees
Labels
No labels
Activity
mohamd764 commentedon Oct 16, 2026
print(df)only shows a preview (the first 10 rows by default), so "Data truncated." doesn't mean the result is incomplete. I checked these options with datafusion 55.0.0 (Python 3.13, Linux) using your table:configure_formatterapplies to every DataFrame for the rest of the session.reset_formatter()from the same module restores the defaults.One thing to watch for:
print(df)anddf.show()run the query each time. If you want to look at the result more than once, convert it once (for examplepdf = df.to_pandas()), or usedf.cache()to keep it in memory.l1t1 commentedon Oct 16, 2026
Thanks @mohamd764