Skip to content

feat: Add checked_element_at for Spark ANSI mode array/map access#16359

Open
n0r0shi wants to merge 1 commit intofacebookincubator:mainfrom
n0r0shi:checked-element-at
Open

feat: Add checked_element_at for Spark ANSI mode array/map access#16359
n0r0shi wants to merge 1 commit intofacebookincubator:mainfrom
n0r0shi:checked-element-at

Conversation

@n0r0shi
Copy link

@n0r0shi n0r0shi commented Feb 12, 2026

Summary

Add checked_element_at that throws on array out-of-bounds access and missing
map keys, instead of returning null. This matches Spark's ANSI mode behavior
where ElementAt with failOnError=true raises exceptions.

Reuses the existing SubscriptImpl template with allowOutOfBound=false and
throwOnMissingMapKey=true. Both error paths support TRY() wrapping.

Test plan

  • Array: normal access, out-of-bounds throws, TRY() returns null
  • Map: normal access, missing key throws, TRY() returns null

Closes #16358

@netlify
Copy link

netlify bot commented Feb 12, 2026

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 42df6bc
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/69900f18ecc6f30008cfdda1

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 12, 2026
Add checked_element_at that throws on array out-of-bounds access and
missing map keys, instead of returning null. For Spark ANSI mode support.
@n0r0shi n0r0shi marked this pull request as ready for review February 14, 2026 05:59
@n0r0shi
Copy link
Author

n0r0shi commented Feb 14, 2026

Added a doc. Ready for a review.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add checked_element_at for Spark ANSI mode array/map access

1 participant