Skip to content

[FEATURE] Return SQL NULL from json_equal and aws_policy_equal for NULL arguments #914

Closed

Description

@jeffreyaven

Migrated from stackql/any-sdk#147: stackql/any-sdk#147
Priority: MEDIUM
Effort: LOW

The SQL functions now live in StackQL, not omnisdk:

  • internal/stackql/sqlengine/internal/sqlfuncs/jsonequal.go
  • internal/stackql/sqlengine/internal/sqlfuncs/awspolicyequal.go

Both current implementations still reject SQL NULL arguments. This makes optional properties fail a whole query and requires COALESCE guards in stackql-deploy statechecks.

Acceptance:

  • json_equal(NULL, value), json_equal(value, NULL) and json_equal(NULL, NULL) return SQL NULL.
  • aws_policy_equal has the same NULL propagation, including NULL versus NULL.
  • SQL NULL remains distinct from the JSON text 'null'.
  • Preserve non-NULL comparison semantics, including the documented aws_policy_equal byte-identical shortcut. Do not broaden this change into unrelated JSON parsing behavior.
  • Keep malformed non-NULL input errors on paths that currently parse and reject it.
  • Update the four NULL-side golden vectors, add both-NULL cases, and update DIVERGENCES.md and function documentation in the current StackQL sqlfuncs package.
  • Add a local SQL-engine regression showing a NULL optional property does not abort all rows and that WHERE comparison = 1 excludes the NULL result as expected.
  • No live cloud credentials are needed for regression tests.

The original issue contains the motivating awscc S3 and stackql-deploy examples. This is host SQL-engine work and has no new omnisdk prerequisite.

Activity

  1. jeffreyaven commented on Nov 18, 2026

    @jeffreyaven
    MemberAuthor

    Closing as resolved by #933, with the additional OmniSDK WHERE-evaluation fix and end-to-end coverage in #934. The corresponding OmniSDK fix was merged in stackql-labs/omnisdk#60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions