Skip to content

Add dictionary support to unhex and test dictionary and scalar cases #477

Closed

Description

@kazuyukitanimura

Describe the bug

Right now unhex does not handle dictionary types. (Scalar is supported but we do not have tests)
Need to add tests for both dictionary and scalar types

Steps to reproduce

No response

Expected behavior

No response

Additional context

No response

Activity

  1. kination commented on Jul 29, 2025

    @kination
    Contributor

    @kazuyukitanimura sorry for question.
    Is it meaning unhex cannot decode correctly if value is dict? For example...

    SELECT decode(unhex('<source>'), 'UTF-8'); 
    

    it works well if source hex data is String such as Spark, but it fails if it is { "target": "spark" }
    -> Am I understanding correct?

  2. kazuyukitanimura commented on Jul 31, 2025

    @kazuyukitanimura
    ContributorAuthor

    Thanks @kination
    In the unhex test https://github.com/apache/datafusion-comet/blob/main/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala#L1433
    We only have limited test cases.
    You can use makeParquetFileAllPrimitiveTypes to create test dictionary values and some random values

    The test case with dictionary may fail because I do not see dictionary handling at https://github.com/apache/datafusion-comet/blob/main/native/spark-expr/src/math_funcs/unhex.rs#L67

    It is possible the tests with dictionary still passes if we are unpacking in advance. But I forgot we are doing so

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

    area:expressionsExpression evaluationbugSomething isn't workinggood first issueGood for newcomerspriority: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