Skip to main content

Native SQL Support

Algeon selects a whole DataFusion physical-plan candidate for cuDF execution when every operator, expression, type and source in it has a native kernel with matching semantics. Memory capacity does not govern planning support. An admitted query executes within its assigned grant and returns a typed allocation error if device memory is exhausted. For a production query, algeon_explain_coverage reports the exact coverage; this page summarizes the rules.

Relational plan shapes​

AreaNative forms
SourcesLocal and S3 object-store Parquet. Projected columns, row-group selection, partition columns, reader predicates and scan limits when their contracts are supported.
Row operationsFilters, projections, stable or unstable sorts, LIMIT/OFFSET, and schema-compatible UNION ALL. A merge of sorted partitions lowers as one sort by its keys, and a UNION ALL that DataFusion plans as InterleaveExec lowers as a union. A distinct UNION and SELECT DISTINCT are grouped aggregates.
AggregationGlobal and grouped aggregation, admitted grouping sets, aggregate filters, and partial/final state when the state is explicitly modeled.
Windowsrank, row_number, lag, lead, whole-partition aggregate windows, and cumulative sum/min/max over ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. rank, lag and lead require ORDER BY; row_number does not. An empty OVER () aggregates the whole input as one partition.
JoinsEqui joins and admitted residual or keyless forms for inner, outer, semi, anti, mark and cross joins. Build side, output projection, key types and residual expressions can narrow an otherwise supported join kind.
Graph, vector, MLUDTFs are separate GPU execution domains. See the cuGraph, cuVS and cuML SQL APIs.

When a candidate is not supported, or a preference rule keeps it on DataFusion, the DataFusion baseline remains in place.

Expressions​

ExpressionNative forms
ValuesColumns and literals.
Arithmetic+, -, *, /, % and unary minus. Decimal % is not native. Integer /, any % and timestamp +/- are not evaluated in reader predicates; join conditions evaluate them only in parts that cannot fail.
Timestamp arithmeticTwo timezone-free timestamps of one unit subtract to a Duration of that unit. Such a timestamp plus or minus a duration gives a timestamp. Duration plus duration, date plus or minus duration, and date minus date are not native.
Comparison and logicComparisons, AND, OR, NOT, null tests.
ConditionalsCASE.
Strings and listsCase-sensitive LIKE and literal IN lists.
TRY_CASTString to integer.

Integer division, checked casts and timestamp arithmetic can fail the query on the rows they evaluate. Native Evaluation Semantics states those rows, and how CASE, AND and OR limit them.

Casts​

FromTo
Any integer typeAny integer type, Utf8, LargeUtf8, Utf8View, Decimal128, or a timestamp.
Float32, Float64Any integer type or Decimal128.
Decimal128(p, 0)Any integer type.
Decimal128Decimal128 of another precision or scale.
Timestamp without a time zoneAnother resolution, DATE, or BIGINT.
DurationAnother resolution or BIGINT.
DATEA timestamp.

Not native: a float or boolean to a string, a timestamp to a numeric type other than BIGINT, and any cast from a timezone-aware timestamp. A cast to BIGINT yields the stored count in the type's own unit, so CAST(next_view - event_time AS BIGINT) over TIMESTAMP(3) columns is a millisecond difference.

Scalar functions​

FamilyFunctions and limits
Stringssubstring/substr, lower, upper, trim/btrim, ltrim, rtrim, contains, starts_with, ends_with, character_length/length, octet_length, regexp_replace, concat. A substring start and optional length are literal integers with start >= 1 and length >= 0. Pattern, trim and replacement arguments are literals. octet_length counts UTF-8 bytes without normalization, so it differs from character_length on multi-byte and combining characters.
Numericabs, sqrt, ln, exp, floor, ceil, round with an optional literal integer scale. floor and ceil take Float32 or Float64 and pass NaN and infinities through. Decimal arguments are not native. ln and exp follow IEEE results and can differ from DataFusion CPU in the last bits.
Nullsnullif for compatible native types.
Temporaldate_part/extract for year, month and day over DATE or timezone-free timestamps, and for hour, minute, second, millisecond and microsecond over timezone-free timestamps of any resolution, each returning INT with DataFusion's values (millisecond and microsecond include the whole seconds of the minute). date_trunc for day through microsecond units on timezone-free timestamps, to_timestamp_seconds for supported integer inputs. date_part('epoch', ...) and nanosecond are not native. DataFusion drops the fractional seconds of a duration longer than about 2.1 seconds there, so cast to BIGINT and divide instead.

Carry types from Data Type Support can be selected and returned but are not valid expression values, keys, sort or partition values, or aggregate and window inputs. A global COUNT(column) without DISTINCT, FILTER or GROUP BY over a List, LargeList or FixedSizeList column is accepted and counts the non-null rows without reading the list values.

Aggregates​

Native aggregate functions are sum, min, max, count, avg, median, stddev/stddev_samp, stddev_pop, var/variance/var_samp/var_sample and var_pop/var_population. COUNT(DISTINCT expression) is supported; other distinct aggregates and ordered aggregate arguments are not.

  • avg keeps sum and count state for partial/final execution and divides as DataFusion does: a Decimal128 average truncates toward zero at its output scale. avg over a Decimal128 with precision above 25 is not native, because DataFusion sums it as Decimal256.
  • median is single-stage, and a plan that mixes it with floating statistical aggregates is rejected.
  • SELECT DISTINCT and a distinct UNION are grouped aggregates over every output column. The final stage may read the partial stage through a repartition, a coalesce, or a merge of sorted partitions without a fetch. All three lower to one native aggregate. A final stage that reads any other operator is rejected, and the rejection names it.
  • An aggregate with COUNT(DISTINCT expression) reads its whole input before grouping, and that input must fit the memory grant. The optimizer splits it into two streaming groupings when every distinct count reads the same expression without FILTER, the other aggregates are sum, min, max, count or avg, and there are no grouping sets. A median or statistical aggregate beside the distinct count keeps the whole-input form.
  • Floating statistical aggregates run under the GPU-tolerant policy by default and can differ from DataFusion. The exact-host policy matches DataFusion with fewer supported key and aggregate types. See statistical_aggregate_execution_mode in configuration.

Sources​

Parquet is the native file format, read from local paths or s3:// object stores. Schema mapping and remote read capability are validated before execution, and a scan that fails either check keeps the DataFusion baseline. Iceberg tables from REST and Glue catalogs scan as Parquet; see Iceberg support for the table features that are rejected. Validate ad-hoc SQL with algeon_explain_coverage, or EXPLAIN GPU over Flight SQL, against the catalog and server configuration that will execute it. The coverage page shows both forms and the runtime_caveats to read.