struct_funcs Expression Audits#
Audit notes for expressions in this category that have been audited. Absence of an entry means the expression has not been audited yet, not that it is unsupported. See the user guide Spark Expression Support for current support status.
named_struct#
Spark 3.4.3 (audited 2026-05-27): identical to 3.5.8.
Spark 3.5.8 (audited 2026-05-27): baseline.
CreateNamedStruct(children)withNoThrow;childrenisSeq(name1, val1, name2, val2, ...). Names must be foldableStringTypeand distinct; non-null.dataTypeis theStructTypeof the resulting fields. Comet routes viaCometCreateNamedStruct, builds aCreateNamedStructproto, and the nativeCreateNamedStructexpression (innative/spark-expr/src/struct_funcs/create_named_struct.rs) emits aStructArray.Spark 4.0.1 (audited 2026-05-27): semantics unchanged; an
override def stateful: Boolean = trueflag is added for the optimizer. Parser-level Alias unwrapping (case (a: Alias, _) => Seq(Literal(a.name), a)) is transparent to Comet.Spark 4.1.1 (audited 2026-05-27): semantics unchanged; adds
override def contextIndependentFoldable: Boolean = children.forall(_.contextIndependentFoldable)for the new constant-folding pass; no impact on Comet conversion.Comet limitation: a
CreateNamedStructwhose names contain duplicates falls back to Spark. (Spark’s analyzer also tolerates duplicates at the column-name level, but the proto layer would lose them, so the fallback is the safe choice.)
struct#
Spark 3.4.3 (audited 2026-05-27): identical to 3.5.8.
Spark 3.5.8 (audited 2026-05-27): the SQL function
struct(a, b, c)is built byCreateStruct.create, which lowers to aCreateNamedStructwith synthetic field namescol1,col2, etc. Comet handles bothstructandnamed_structvia the sameCometCreateNamedStructpath; the synthetic-name and explicit-name cases behave identically.Spark 4.0.1 (audited 2026-05-27): same lowering; identical to 3.5.8.
Spark 4.1.1 (audited 2026-05-27): same lowering; identical to 3.5.8.