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

[C++] Add overflow argument is required when it shouldn't be

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 11.0.0
    • C++

    Description

      If I pass a substrait plan that contains an add function, but don't provide the nullablity argument, I get the following error:

      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "pyarrow/_substrait.pyx", line 140, in pyarrow._substrait.run_query
        File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
        File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
      pyarrow.lib.ArrowInvalid: Expected Substrait call to have an enum argument at index 0 but the argument was not an enum.
      /Users/willjones/Documents/arrows/arrow/cpp/src/arrow/engine/substrait/extension_set.cc:684  call.GetEnumArg(arg_index)
      /Users/willjones/Documents/arrows/arrow/cpp/src/arrow/engine/substrait/extension_set.cc:702  ParseEnumArg(call, 0, kOverflowParser)
      /Users/willjones/Documents/arrows/arrow/cpp/src/arrow/engine/substrait/relation_internal.cc:332  FromProto(expr, ext_set, conversion_options)
      /Users/willjones/Documents/arrows/arrow/cpp/src/arrow/engine/substrait/serde.cc:156  FromProto(plan_rel.has_root() ? plan_rel.root().input() : plan_rel.rel(), ext_set, conversion_options)
      /Users/willjones/Documents/arrows/arrow/cpp/src/arrow/engine/substrait/util.cc:106  engine::DeserializePlans(substrait_buffer, consumer_factory, registry, nullptr, conversion_options_)
      /Users/willjones/Documents/arrows/arrow/cpp/src/arrow/engine/substrait/util.cc:130  executor.Init(substrait_buffer, registry)
      

      Yet in the spec, this argument is supposed to be optional: https://github.com/substrait-io/substrait/blob/f3f6bdc947e689e800279666ff33f118e42d2146/extensions/functions_arithmetic.yaml#L11

      If I modify the plan to include the argument, it works as expected.

      Attachments

        1. generate_ibis_queries.py
          2 kB
          willjones127
        2. try_queries_acero.py
          0.9 kB
          willjones127

        Activity

          People

            Unassigned Unassigned
            wjones127 Will Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: