Skip to content

Fix 3 buggy starrocks__ macro variants (json_extract_value, from_iso8601_timestamp, array_join) #2397

Description

@blarghmatey

Expected Behavior

The three existing starrocks__ macro variants compile and produce correct results on a StarRocks cluster.

Current Behavior

Doc-verified against docs.starrocks.io, three starrocks__ variants are buggy:

  1. starrocks__json_extract_value uses json_extract, which does not exist in StarRocks.
  2. starrocks__from_iso8601_timestamp is a bare cast(x as datetime) — a trailing 'Z' or '±HH:MM' makes the cast fail → NULL.
  3. starrocks__array_join silently drops the null_replacement argument, but StarRocks array_join supports the 3rd null_replace_str arg.

Possible Solution

  1. json_query(parse_json({{ json_col }}), {{ json_path }}).
  2. cast(substr(replace(regexp_replace(x, '([Zz]|[+-][0-9]{2}:?[0-9]{2})$', ''), 'T', ' '), 1, 26) as datetime) (StarRocks DATETIME is zone-less; naive and Z-suffixed agree; non-UTC offsets are dropped — acceptable, this project's data is UTC/naive).
  3. Mirror the Trino branch structure to pass the 3rd arg (docs: array_join([1,3,5,null],'_','NULL')).

Additional Details

Full report in witan project fact pf-ol-dbt-cross-database-macro-dispatch-state-and-s-086e50.


P1. Part of #2375 (2026-07 dbt warehouse audit). Witan task: tk-fix-3-buggy-starrocks-macro-variants-json-extrac-0d99b6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions