Repository navigation
Releases
Releases · hakimjonas/vaire
1.1.0-alpha.1
See CHANGELOG.md.
1.1.0-alpha
- Keyed-join index, null model, and Spark source validation — the keyed-join index is
now unboxed, and the null model, keyed-join semantics, and Spark source contract now match
Spark 4.2. Several changes are breaking; see below.
Breaking changes
- Keyed joins require matching key types.
leftKeyTypeandrightKeyTypemust be equal;
a mismatch fails withExecutionError.TypeMismatchinstead of silently returning no rows.
The prior index matched keys across primitive types by boxed numeric equality (including
Long/Timestamp/TimeandInt/Decimal), and its fast path was order-dependent
(Long ⋈ Timereturned no rows whileTime ⋈ Longmatched). Cast one side to widen
(InttoLong). - Null keys never match. Spark 4.2 runs ANSI mode by default and
EqualTois
null-intolerant; the in-memory keyed joins now follow. A null that previously joined to a
null now matches nothing and appears as an unmatched row in outer joins. Option[A]is a single nullable column.Schema.optionSchemano longer stores a
presenceBooleanplus the inner columns; it stores one column whereNoneis a null,
wrapped in a struct column whenAflattens to several columns (a tuple or a derived case
class). Join outputs ((A, Option[B])),Schema.derivedforOptionfields, and the Spark
schema (one nullable field instead of two) all change layout. Code that assumed the presence
column, or persisted data in the old layout, must be migrated.- Non-optional fields are null-free.
Dataset.fromColumnsrejects a null in a
non-optional field withSchemaError.NullInNonNullableColumn; aDataset[Int]built from a
nullable column must becomeDataset[Option[Int]]. - Spark source schemas must agree on nullability. Reading a DataFrame whose field is
nullable into a non-optional Vairë field fails at execution
(ExecutionError.InvalidPlan); declare the fieldOption, or make the Spark field
non-nullable.Dataset.narrow[U]asserts non-null against the data when the source is
nullable by declaration. - Decoding a null into a non-optional target is a typed error.
DecodeError.NullValue
surfaces asExecutionError.DecodeFailed, andMaterializedDataset.toVectorOrErroris the
safe accessor.RowConverter.fromRowUnsafeis removed;toVectorUnsaferemains and throws
on a decode failure instead of returning a null. - The declared
ColumnTypeis validated against the resolved column. Keyed joins,
groupByAggkeys,sortByExpr,sortByExprs, and window partition/order now fail with
ExecutionError.TypeMismatchwhen the declared type disagrees with the column, in both
backends. A wrongColumnTypeis no longer ignored. - New enum cases.
ExecutionError.DecodeFailedandSchemaError.NullInNonNullableColumn
are added; exhaustive matches on these enums need updating. - Derived schemas name columns after the field.
Schema.derivednames a field that
flattens to one column<field>instead of<field>_value; a field that flattens to
several columns keeps<field>_<inner>.Trade(symbol, price, quantity)now produces
symbol,price,quantity, and anOption,structColumn, or other single-column field
is named after the field. Spark DataFrame column names,showheaders, and join output
names follow.
Additions
Dataset.narrow[U]reinterprets the schema, asserting that fieldsUdeclares
non-optional hold no nulls, in both backends.- Unboxed keyed-join index — the per-join
HashMap[Any, Vector[Int]]is replaced by an
unboxed index: dense keys use a direct-address array (key - min), sparse keys an
open-addressing table, both mapping a key to the head of a flat chain. On one machine,
100k-10M, 2-4x faster than the boxed index and 3-10x less allocation, with the 10M GC time
dropping to zero; seedocs/join-optimization-plan.md, Phase 1e. - Predicate-join memory —
fullJoinrecords matches per row instead of materializing the
n·m pair vector and two value sets. This also fixes a case where a row equal by value to a
matched row, but different under the condition, was left out of the unmatched output. The
other predicate joins short-circuit empty inputs.KeyedJoinEquivalenceSpecand
JoinOpsSpecpin the keyed-join and full-join semantics.