|
29 | 29 | class Context(SessionContext): |
30 | 30 | """A datafusion `SessionContext` that also supports `xarray.Dataset`s. |
31 | 31 |
|
32 | | - Without a `config`, a context splits a query's work across partitions |
33 | | - only where enough rows reach it, by DataFusion's estimate. DataFusion |
34 | | - otherwise splits every input whose row count is an estimate, as it is |
35 | | - after a join, a filter or an aggregate, however few rows that is. |
36 | | - Splitting small inputs makes a query of a few thousand rows two to |
37 | | - three times slower to run. A `config` given is used as it is. |
38 | | -
|
39 | 32 | Also available under its original name, ``XarrayContext``. |
40 | 33 | """ |
41 | 34 |
|
42 | 35 | def __init__(self, config: SessionConfig | None = None, *args, **kwargs): |
43 | 36 | if config is None: |
| 37 | + # Split a query's work across partitions only where enough rows |
| 38 | + # reach it, by DataFusion's estimate. DataFusion otherwise splits |
| 39 | + # every input whose row count is an estimate, as it is after a |
| 40 | + # join, a filter or an aggregate, however few rows that is, which |
| 41 | + # makes a query of a few thousand rows two to three times slower |
| 42 | + # to run. A config given is used as it is. |
| 43 | + # |
44 | 44 | # A bare SessionConfig turns off the information schema, which |
45 | 45 | # SessionContext() turns on; otherwise the two are the same. |
46 | 46 | config = ( |
|
0 commit comments