sdf run sql
Use the SQL mode in the CLI, to be able to run SQL queries on SDF states. For a given dataflow, we will have in context for SQL all the dataframe states, which are essentially the states with an arrow-row
value.
For states that are scoped to a window, we will have access to the last flushed state. For states that are not window aware we will have access to the global state.
In order to enter the SQL mode, type sql
in the SDF interactive shell created through sdf run
or sdf deploy
. In the SQL mode we could perform any sql command supported by the polars engine.
We can use the .help
command to see the available options.
sql >> .help
shape: (3, 2)
┌─────────┬─────────────────────────────────┐
│ command ┆ description │
│ --- ┆ --- │