Skip to content

Native engine crashes on literal sha2() with 'Unsupported argument types' #3340

Closed

Description

@andygrove

Description

When Spark's ConstantFolding optimizer rule is disabled, an all-literal sha2() call reaches the native engine, which crashes with:

Unsupported argument types for sha2 function

How to Reproduce

SET spark.sql.optimizer.excludedRules=org.apache.spark.sql.catalyst.optimizer.ConstantFolding;
SELECT sha2('test', 256);

Expected Behavior

The native engine should handle literal sha2 inputs gracefully — either by computing the correct result or by falling back to Spark.

Activity

  1. 0lai0 commented on Feb 10, 2026

    @0lai0
    Contributor

    take

  2. 0lai0 commented on Feb 10, 2026

    @0lai0
    Contributor

    @andygrove I'm not sure should I add sha2.rs in native/spark-expr/src/hash_funcs/ or use fallback to spark.
    Please let me know which one is better, thanks !

  3. parthchandra commented on Feb 14, 2026

    @parthchandra
    Contributor

    @0lai0 why not try the native code path first and if that fails, fallback to spark.

  4. 0lai0 commented on Feb 17, 2026

    @0lai0
    Contributor

    Thanks @parthchandra for the feedback. I'll incorporate these suggestions into the update. Thank you!

  5. added
    priority:highCrashes, panics, segfaults, major functional breakage
    priority:lowMinor issues, test failures, tooling, cosmetic
    and removed
    priority:highCrashes, panics, segfaults, major functional breakage
    on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:expressionsExpression evaluationbugSomething isn't workingcrashNative engine crash/panic/segfaultpriority:lowMinor issues, test failures, tooling, cosmetic

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions