Skip to content

Add emulation function for Snowflake's OBJECT_AGG()#539

Merged
danieldeleo merged 1 commit into
GoogleCloudPlatform:masterfrom
Hackerpilot:object_agg
Jun 2, 2026
Merged

Add emulation function for Snowflake's OBJECT_AGG()#539
danieldeleo merged 1 commit into
GoogleCloudPlatform:masterfrom
Hackerpilot:object_agg

Conversation

@Hackerpilot

Copy link
Copy Markdown
Collaborator

No description provided.

@danieldeleo

Copy link
Copy Markdown
Collaborator

/gcbrun

@danieldeleo danieldeleo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hackerpilot I think it'd be good to add unit tests that confirm it behaves exactly the same as snowflake:

Usage notes:

  • Input tuples with NULL key and/or value are ignored.
  • Duplicate keys within a group result in a Duplicate field key 'key' error.
  • The DISTINCT keyword is supported, but it only filters out duplicate rows where both key and value are equal.

@Hackerpilot

Copy link
Copy Markdown
Collaborator Author
  • "When a JavaScript UDAF is called with the IGNORE NULLS argument, BigQuery automatically skips over rows for which any aggregate argument evaluates to NULL. "
  • This case is handled, but our testing functions currently don't have a way to specify that a function is expected to result in an error.
  • This is now handled by a NOT AGGREGATE argument (which will be added automatically by the translation engine).

@danieldeleo danieldeleo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

@danieldeleo

Copy link
Copy Markdown
Collaborator

/gcbrun

@danieldeleo danieldeleo merged commit 0754ad8 into GoogleCloudPlatform:master Jun 2, 2026
92 checks passed
Hackerpilot added a commit to Hackerpilot/bigquery-utils that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants