Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11508

[C++][Compute] Add support for generic conversions to Function::DispatchBest

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • C++
    • None

    Description

      ARROW-8919 adds support for execution with implicit casts to any function which overrides DispatchBest, allowing functions to specify conversions which make sense in that function's context. For example "add" can promote its arguments if their types disagree. By contrast, some conversions are more generic and could be applicable to any function's arguments. For example if any datum is dictionary encoded, a kernel which accepts the decoded type should be usable with an implicit decoding cast:

      import pyarrow as pa
      import pyarrow.compute as pc
      
      arr = pa.array('hello ' * 10)
      enc = arr.dictionary_encode()
      
      # result should not depend on encoding:
      assert pc.ascii_is_alnum(arr) == pc.ascii_is_alnum(enc)
      
      # currently raises:
      # ArrowNotImplementedError: Function ascii_is_alnum has no kernel matching
      #    input types (array[dictionary<values=string, indices=int32, ordered=0>])
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bkietz Ben Kietzman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: