> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Generator and table-valued functions

> Spark generator and table-valued functions supported in SparkSQL and Databricks compatibility modes.

Preview

Spark [generator functions](https://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#generator-functions) in [SparkSQL and Databricks compatibility modes](https://docs.firebolt.io/reference-sql/spark/overview.md). Both modes share these functions. Support is one of: Supported, With limitations, or Not supported. Supported means every example in the Spark reference returns what Spark returns; a note under With limitations quotes a call that differs.

| Function | Support | Notes |
| :- | :- | :- |
| [`RANGE`](https://spark.apache.org/docs/4.1.0/api/sql/#range) | Supported | |
| [`EXPLODE`](https://spark.apache.org/docs/4.1.0/api/sql/#explode) | With limitations | Supported in a `FROM` clause, as in `SELECT col FROM explode(array(1, 2))`. Not supported in the select list. |
| [`POSEXPLODE`](https://spark.apache.org/docs/4.1.0/api/sql/#posexplode) | With limitations | Supported in a `FROM` clause, as in `SELECT pos, col FROM posexplode(array('a', 'b'))`. Not supported in the select list. |
| [`STACK`](https://spark.apache.org/docs/4.1.0/api/sql/#stack) | With limitations | Supported in a `FROM` clause, as in `SELECT * FROM stack(2, 1, 2)`. Not supported in the select list. |
| `EXPLODE_OUTER`, `INLINE`, `INLINE_OUTER`, `POSEXPLODE_OUTER` | Not supported | |

## Limitations

* A generator in the select list, such as `SELECT explode(arr) FROM t`, is not supported. Call it in the `FROM` clause instead.
* `LATERAL VIEW` and `LATERAL` table functions, such as `FROM t, LATERAL explode(t.arr)`, are not supported, so a generator cannot read a column of another table in the same `FROM` clause.
* `IDENTIFIER('t')` in a `FROM` clause names a table, as in Spark.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.