Same answer across backends

FeatureQL is one language. The compiler emits different SQL for each backend (DuckDB, Trino, PostgreSQL, Snowflake, Databricks, BigQuery and ClickHouse in batch, DataFusion in serving) so the FeatureQL-visible result matches when the engine can do the work.

That is why a feature you authored on DuckDB can compile as a persisted view for Snowflake or Trino and as a prepared statement for serving without rewriting the formula. The engines still disagree on some algorithms and types; those stay honest errors or documented gaps, not silent different numbers.

Targets and how far each one goes

A target is a family, an optional variant, and an optional version range: duckdb@2.0, trino/athena, mysql/mariadb. featuremesh.targets() lists them, with scope (full or partial, and the limits of a partial target). Every target in that list runs the conformance suite , and a construct a target cannot run is refused at compile time with a named UE/…, never a different answer. What differs is the scope.

TargetsScopeUsed for
duckdb (1.5 to 2.0), trino, postgres, snowflake, databricks, bigquery, clickhouse, serving (DataFusion)The whole language.Batch, views, serving
trino/presto (PrestoDB, Java), trino/presto/native (Presto C++ on Velox), trino/athena (AWS Athena engine v3), trino/athena/local (the local Athena stand-in)The whole language. They are variants of Trino: each engine difference is rewritten, or refused by name. Target variants lists the refusals.Batch, views
mysql (MySQL 9.7), mysql/mariadb (MariaDB 11.4)Partial: every feature except ARRAY and ROW values, which these engines do not have (UE/ARRAY-TYPE-NOT-SUPPORTED-DIALECT, UE/ROW-TYPE-NOT-SUPPORTED-DIALECT). A function with no exact form there is refused (UE/FUNCTION-NOT-AVAILABLE): see MySQL and MariaDB .Mainly serving: a SOURCE_DB() over MySQL or MariaDB computes a key's aggregations in the database, from SQL compiled for this target. Batch queries without arrays also run.

On MySQL, use 9.7: MySQL 8.4 returns wrong rows for some IN (subquery) plans (a semijoin bug fixed in 9.7; SET optimizer_switch='materialization=off' avoids it on 8.4).

Other engines are evaluated on our side before they become targets. Until then they are not in targets(), the Python library or these docs.

Same FeatureQL, different SQL

These calls look like DuckDB. On Trino they become date_format, from_iso8601_timestamp (after a space→T rewrite), and json_extract_scalar. The values stay the same:

FeatureQL
RETURN
    iso := TO_ISO8601(DATE '2024-03-15'),
    ts := FROM_ISO8601_TIMESTAMP('2024-03-15T10:30:00'),
    name := JSON_EXTRACT_SCALAR(
        JSON_PARSE('{"name":"Alice","age":30}'),
        '$.name'
    )
;
Result
ISO VARCHARTS TIMESTAMPNAME VARCHAR
2024-03-15T00:00:002024-03-15T10:30:00Alice

Use FeatureQL functions (TO_ISO8601(), FROM_ISO8601_TIMESTAMP(), JSON_EXTRACT_SCALAR()), not dialect builtins (strftime, from_iso8601_timestamp, json_extract). The compiler already owns the spelling.

Raw FROM SQL(...) inside EXTERNAL_COLUMNS() / BIND_COLUMNS() is the opposite contract: that string is engine SQL. Use it to declare a source or to prototype, not to compute business logic. Prefer INLINE_COLUMNS when the same query must run everywhere. Details: Mapping data sources .

What the compiler normalizes

When a backend is missing a builtin, or the builtin would change the answer, FeatureQL rewrites the tree:

FeatureQLWhat we do
TO_ISO8601(DATE …)Trino native to_iso8601 drops T00:00:00; we emit date_format so the string matches DuckDB
INTERVAL valuesEngines disagree on intervals (DuckDB, Postgres and BigQuery treat a month as 30 days when comparing; Trino, Databricks and Snowflake cannot mix months and days). Every backend stores an interval as one decimal, months × 10^20 + microseconds, so comparisons, arithmetic and the ISO 8601 text are identical everywhere
FROM_ISO8601_TIMESTAMP()Trino requires T; a space-separated string is rewritten first
UTC_TO_LOCAL() / LOCAL_TO_UTC()TIMESTAMP is UTC and TIMESTAMPTZ a local clock time; both are stored as plain timestamps, so the engine session zone never shifts them
DATE_SUBTRACT(…, month/year)Serving has no calendar date_sub; we use the same elapsed helper as Trino
JSON '…' / DISPLAYS AS on JSON objectsObject/array text is compared as JSON, not as pretty strings
JSON_KEYS()Engines return keys in storage order (document order, or sorted); FeatureQL sorts them by code point on every backend
SQLTYPEOF()Available on serving and Trino; the string is the engine's type name (next section)

Purity and explicit casts are the language half of this story: Design principles . Types: Types .

What the engine still owns

These are not compiler bugs. No SQL tweak makes the engines agree, so FeatureQL either pins the difference, raises a stable UE/…, or leaves the function unavailable.

Approximate sketches. APPROX_DISTINCT (HLL) and APPROX_PERCENTILE are engine sketches. Two backends can return different values on the same rows. MEDIAN is exact everywhere: on an even count it is the mean of the two middle values, also on Trino and BigQuery, which have no exact median of their own.

Last-bit floating point. Computed DOUBLE values (sums, products, IEEE values past 2^53) can differ by a ULP between engines. FeatureQL DOUBLE is not a cross-engine exact decimal. Constants such as E() are emitted as the nearest double, so they are identical.

Products. Only DuckDB and Trino have a product aggregate. Elsewhere PRODUCT() is EXP(SUM(LN(|x|))), with zeros and the sign counted apart, so a DOUBLE product can differ in its last digits. PRODUCT() OVER on an integer or DECIMAL must be exact, so it runs on DuckDB and Trino only and raises UE/WINDOW-PRODUCT-NOT-SUPPORTED-DIALECT elsewhere; cast the argument to DOUBLE to run it everywhere.

Types the engine does not have. BITSTRING is not a Trino type. Integer BITWISE_* exists; bitstring literals do not. Geospatial ST_* coverage differs per engine; see the geospatial sections below.

Values the declared type does not fit. EXTERNAL_COLUMNS reads each column as the type you declare. The compiler does not look at the stored values ( data contracts ). When a stored value does not fit the declared type, the value you get is the engine's own conversion, and the engines disagree:

Stored value → declared typeDuckDBPostgresTrinoClickHouseServingBigQuerySnowflakeDatabricks
1.5 DECIMAL → BIGINT22211221
2.5 DECIMAL → BIGINT33322332
-1.5 DECIMAL → BIGINT-2-2-2-1-1-2-2-1
2.5 DOUBLE → BIGINT22322332
1.235 DECIMAL(10, 3) → DECIMAL(10, 2)1.241.241.241.231.241.241.241.24
3000000000 BIGINT → INTEGERerrorerrorerror-1294967296error30000000003000000000error
'abc' VARCHAR → BIGINTerrorerrorerrorNULLerrorerrorerrorerror
'yes' VARCHAR → BOOLEANTRUETRUEerrorTRUETRUEerrorTRUETRUE
TRUE BOOLEAN → BIGINT1error111111

These agree on every backend: '12' read as BIGINT is 12, '2026-01-02' read as DATE is that date, a TIMESTAMP read as DATE drops the time, a DATE read as TIMESTAMP is midnight, and 42 read as VARCHAR is '42'.

An error here is the engine's execution error, not a UE/…, and a wrong value raises nothing. Declare the type the column stores, and convert in a feature: CAST is a FeatureQL function, so it gives the same value on every backend (CAST(1.5 AS BIGINT) is 2, half away from zero). The conformance suite records this table, so a change in an engine shows up.

NULL arrays inside collections on ClickHouse. ClickHouse stores an array element or a row field of array type as a plain array, which cannot be NULL. A NULL array written inside ARRAY[...] or ROW(...) raises UE/NULL-ARRAY-MEMBER-NOT-SUPPORTED-DIALECT; use an empty array, or keep the array outside the collection. A NULL array on its own, as a feature value, stays NULL.

JSON text. JSON_FORMAT() returns valid JSON text, but its spacing, key order and number spelling are the engine's: DuckDB, Postgres, ClickHouse and serving keep the parsed text, BigQuery, Snowflake, Databricks and Trino print it compact with sorted keys. Compare JSON values (or extracted fields), not JSON text.

Arrays BigQuery cannot return. Inside a query a NULL array is NULL on BigQuery too. Only the result changes: BigQuery writes a NULL array as [], and cannot write an array that holds NULL at all. Rather than return a different value, a returned NULL array raises UE/ARRAY-NULL-NOT-SUPPORTED-DIALECT and a NULL element UE/ARRAY-NULL-ELEMENT-NOT-SUPPORTED-DIALECT, at run time, naming the column. When an empty array is what you want, say so: COALESCE(x, ARRAY[]). Return x IS NULL as well if the difference matters.

Forms that need a different runtime. TRANSFORM(… METHOD CORRELATED) raises UE/TRANSFORM-NOT-IMPLEMENTED on Trino, Snowflake, ClickHouse and serving. Functions that are missing on a backend are listed below . Hybrid FEATUREQL(...) inside /* SQL */ is not supported on serving.

Planning cost. A valid graph can exceed Trino planning time or serving HTTP 408. That is a budget, not an unsupported function.

Storage spelling. TYPEOF() is FeatureQL. SQLTYPEOF() is whatever the engine prints (BIGINT on DuckDB and Trino, INT64 on BigQuery, Int64 on serving):

FeatureQL
RETURN
    fql := TYPEOF(1),
    sql := SQLTYPEOF(1)
;
Result
FQL VARCHARSQL VARCHAR
BIGINTBIGINT

If a query works on one backend and not another, compare TYPEOF / SQLTYPEOF and the structured UE/… code — not the generated SQL first. Inspection: Tools in the query .

Functions missing on a backend

The functions index shows each backend code in green, yellow or red. A yellow or red code links to its reason below. A missing function raises UE/FUNCTION-NOT-AVAILABLE at compile time, never a different answer.

Constant arguments

Yellow means the function runs, but one argument must be a constant on that backend: a literal, or an expression FeatureQL can fold at compile time. Either the engine function only takes a constant, or FeatureQL translates the argument into the engine's own syntax while compiling.

  • DATE_FORMAT() on DuckDB, Postgres, Snowflake and Databricks: the strftime format is translated into the engine's pattern.
  • DATE_PARSE() on DuckDB, Postgres, ClickHouse, Snowflake, Databricks and serving: the same for the parse format. DataFusion's to_timestamp also needs a constant format.

Live sources

SOURCE_HTTP(), SOURCE_DB(), SOURCE_KV() and EXTERNAL_KV() call an HTTP endpoint, a database or Redis while the request runs. Only serving does that. The batch backends run SQL inside the warehouse, which cannot call out per row. This is by design, not a translation gap.

SOUNDEX

SOUNDEX() runs where the engine has a native SOUNDEX that can match Trino's: Trino, Postgres, Snowflake, Databricks and ClickHouse. Serving computes it with Trino's rules too. On Postgres it comes from the fuzzystrmatch extension, which must be installed in the database, as for LEVENSHTEIN_DISTANCE(). DuckDB has no SOUNDEX, and BigQuery's does not treat vowels as separators. Spelling the algorithm out in SQL is an emulation FeatureQL does not ship.

Arrays of arrays on BigQuery

NGRAMS(), COMBINATIONS() and PERMUTATIONS() return an array of arrays, which BigQuery cannot hold.

Engine version on BigQuery

SQLVERSION(): BigQuery exposes no engine version.

RECURSE on Trino

RECURSE(): Trino unrolls a recursion to its maximum depth while planning and copies the edge query into each level. Even a depth of 10 hits the planning time limit and the stage cap.

Window percentiles on Postgres

MEDIAN() OVER, QUANTILE_CONT() OVER and QUANTILE_DISC() OVER: Postgres has no percentile window function, and sorting a collected frame for every row is quadratic on a running frame.

Geospatial on ClickHouse

No ST_* function. ClickHouse has only helpers on tuples (pointInPolygon, greatCircleDistance with its own radius and 32-bit math), and nothing maps to the GEOMETRY and GEOGRAPHY types.

Geospatial on BigQuery

BigQuery has GEOGRAPHY but no planar GEOMETRY type, so every GEOMETRY-only function is missing, as are the conversions between the two: ST_GEOMPOINT(), ST_GEOMFROMTEXT(), ST_GEOMFROMWKB(), ST_GEOMFROMGEOJSON(), ST_TOGEOGRAPHY(), ST_TOGEOMETRY(), ST_AZIMUTH(), ST_TOUCHES(), ST_CROSSES(), ST_OVERLAPS(), ST_ISVALID(), ST_ISCLOSED(), ST_ISSIMPLE(), ST_EXTERIORRING(), ST_NUMINTERIORRINGS(), ST_INTERIORRINGN(), ST_CENTROID(), ST_BUFFER(), ST_ENVELOPE(), ST_CONVEXHULL(), ST_SIMPLIFY(), ST_SYMDIFFERENCE(), ST_REVERSE(), ST_SRID(), ST_SETSRID(), ST_TRANSFORM(), ST_SNAP_TO_GRID(), ST_UNION_AGG() and ST_EXTENT(). BigQuery has no collect function either: ST_COLLECT() and ST_COLLECT_AGG(). A GEOMETRY value passed to any other function raises UE/GEOMETRY-NOT-SUPPORTED-DIALECT.

Geospatial on Trino

Trino runs most of the family. Its geometry has no SRID, so ST_SRID(), ST_SETSRID() and ST_TRANSFORM() have no meaning there. Where Trino's function gives another answer, the function is not mapped: ST_BUFFER() approximates the circle with other segments, ST_NUMPOINTS() does not count a ring's closing point, ST_INTERIORRINGN() returns the ring in the other direction, ST_COLLECT() and ST_COLLECT_AGG() write MULTIPOINT ((0 0), (1 1)), ST_MAKELINE() takes points only and ST_MAKEPOLYGON() text only. ST_PERIMETER(), ST_REVERSE() and ST_SNAP_TO_GRID() have no Trino function. On GEOGRAPHY, Trino only measures point distances, areas and lengths on the sphere; other GEOGRAPHY forms raise UE/<FN>-GEOG-NOT-SUPPORTED-DIALECT.

Geospatial on Snowflake

Snowflake has no empty GEOGRAPHY: an empty result would come back as NULL, so ST_INTERSECTION() and ST_DIFFERENCE() are missing. It has no ST_EQUALS(), ST_ISEMPTY() or ST_NUMGEOMETRIES(). Snowflake's GEOMETRY type has fewer functions than its GEOGRAPHY type, and these are not mapped to Snowflake: ST_TOUCHES(), ST_CROSSES(), ST_OVERLAPS(), ST_ISCLOSED(), ST_ISSIMPLE(), ST_EXTERIORRING(), ST_NUMINTERIORRINGS(), ST_INTERIORRINGN(), ST_GEOMETRYN(), ST_CONVEXHULL(), ST_SYMDIFFERENCE(), ST_REVERSE(), ST_SNAP_TO_GRID(), ST_DUMP(), ST_UNION_AGG(), ST_COLLECT_AGG() and ST_EXTENT().

Geospatial on Databricks

Databricks has no ST_ISCLOSED(), ST_ISSIMPLE() or ST_SNAP_TO_GRID(). Its GEOGRAPHY measures on the WGS84 ellipsoid, not on the sphere, so on GEOGRAPHY only point distances run; other GEOGRAPHY forms raise UE/<FN>-GEOG-NOT-SUPPORTED-DIALECT.

Geospatial on serving

Serving links GEOS but not PROJ or S2, so it can run air-gapped. Without PROJ there is no ST_TRANSFORM(). On GEOGRAPHY only point distances run.

MySQL and MariaDB

MySQL and MariaDB are a partial target (mysql, mysql/mariadb): they mainly compute a key's aggregations inside the database for a SOURCE_DB() in serving. The mysql column covers both. What is missing there:

  • Everything that takes or returns an ARRAY or ROW value: the array and array-of-rows functions, TRANSFORM(), ZIP(), UNWRAP(), and the business functions built on arrays. These engines have no such types. What the compiler folds away still works: a ROW(...) read by field, an ARRAY[...] in a BIND_VALUES() list or LIKE ANY (...), and an ARRAY_AGG() reduced to the values it keeps (.UNWRAP_ONE(), a first or top-n selection).
  • Aggregates with no exact MySQL form: MAX_BY(), MIN_BY(), MEDIAN(), QUANTILE_CONT(), QUANTILE_DISC(), APPROX_PERCENTILE(), PRODUCT(), and the correlation and regression family, as aggregates and over windows. STRING_AGG() is missing over a window only.
  • Interval values and the functions that build them, geospatial functions, and the string, math and date functions without an exact counterpart.
  • Live sources: MySQL is the database a SOURCE_DB() reads, not the engine that calls it.

STRING_AGG() runs as GROUP_CONCAT(), with a constant delimiter as on most backends. MySQL cuts a GROUP_CONCAT() result at 1,024 bytes by default; the compiled query raises that limit for itself (SET_VAR hint). MariaDB ignores the hint and cuts at its own default, 1 MB (group_concat_max_len). BIT_AND(), BIT_OR() and BIT_XOR() return NULL for a group with no value and keep negative values, as on the other backends.

Each one is refused at compile time with UE/FUNCTION-NOT-AVAILABLE (or UE/ARRAY-TYPE-NOT-SUPPORTED-DIALECT when the value itself is an array). The functions index lists them in the mysql column.

How to prove it on your stack

The docs and playgrounds are the same SLT corpus, more than 8,000 executable tests. Run it on the backend you care about:

Conformance tests — client.sltest / POST /sltest with backend="trino", "snowflake", "serving" or any other backend.

A persisted view compiles the artifacts of every backend together. If a formula is unavailable on one engine, create fails with that UE/… instead of storing a lie.

Next

Need a SQL table for BI? Persisted views . Need live FeatureQL inside SQL? Hybrid queries (batch backends). Serving latency and sources: The serving backend .