Skip to content

v1.37.0 — value-parity fixes for the pre-sc-30376 StarRocks variants

Choose a tag to compare

@inviscid inviscid released this 25 Sep 17:03
4d9f435

Six value divergences between the StarRocks and Databend renderings of the ~46 pre-existing @compiles variants — expressions that compiled cleanly on both engines and returned different answers. Four fixed, two now refused by name (sc-30414).

Fixed

  • integerize_truncate — a bare DECIMAL cast is DECIMAL(10,0) on StarRocks, so it rounded before truncating: 2.7 → 3, where Databend gave 2. Now pinned to DECIMAL(38,10).
  • regexp_substr — StarRocks' regexp_extract returns '' on no match where Databend returns NULL, so every IS NULL and coalesce() over it was wrong. Now nullif(..., '').
  • regexp_instr — rendered as regexp(), returning 1/0 rather than a 1-based offset; correct only inside the converter's > 0 idiom. Now a NULL-preserving locate(regexp_extract(...)).
  • import_cast — three breaks: the whitespace squash was computed then discarded, so '1 234' imported as NULL where Databend gave 1234; trailing negatives went through a mask StarRocks ignores, so '123-' imported as NULL not −123; 't'/'f' cast straight to BOOLEAN yielded NULL.

Now refused rather than silently wrong

  • to_char(<num>, '<0/9 mask>') — the mask was dropped, and since to_char returns a string the formatting is the value. Date-mask and no-mask paths still render.
  • to_number — Databend renders an integer (to_int64), StarRocks a DECIMAL(38,10): different type, different value.

Swept as a class: a test checks all 79 GenericFunction/ReturnTypeFromArgs classes for a bare CAST(x AS DECIMAL) on StarRocks, and caught a second occurrence on its first run.

Not cleared — five compared, divergence plausible, unsettled without a live engine pair, and named in a failing test so they cannot read as clean: ord, to_string, string_agg, array_to_string, titlecase.

Also here: SQLAlchemy<2.1. 2.1.1 published 2026-09-25 and broke this repo's CI on unmodified master — snowflake-sqlalchemy subclasses ORMSelectCompileState, which 2.1 renamed, so loading the Snowflake dialect raises. Also covers 2.1's _DropView rename and its psycopg3 switch for postgresql://. Lift when snowflake-sqlalchemy supports 2.1.