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

[C++] Typo that causes segfault with unknown functions in Substrait

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.0.0
    • C++

    Description

      There is a typo in ExtensionSet::Make() that causes a crash whenever somebody provides an unsupported function into the Substrait consumer. It looks like this was a copy/paste error here where type_ids should be function_ids.

      https://github.com/apache/arrow/blob/a935c81b595d24179e115d64cda944efa93aa0e0/cpp/src/arrow/engine/substrait/extension_set.cc#L167-L168

      To reproduce via the R bindings:

      arrow:::do_exec_plan_substrait('
      {
        "extensionUris": [
          {
            "extensionUriAnchor": 1
          }
        ],
        "extensions": [
          {
            "extensionFunction": {
              "extensionUriReference": 1,
              "functionAnchor": 2,
              "name": "abs_checked"
            }
          }
        ],
        "relations": [
          {
            "rel": {
              "project": {
                "input": {
                  "read": {
                    "baseSchema": {
                      "names": [
                        "letter",
                        "number"
                      ],
                      "struct": {
                        "types": [
                          {
                            "string": {
      
                            }
                          },
                          {
                            "i32": {
      
                            }
                          }
                        ]
                      }
                    },
                    "namedTable": {
                      "names": [
                        "named_table_1"
                      ]
                    }
                  }
                },
                "expressions": [
                  {
                    "scalarFunction": {
                      "functionReference": 2,
                      "args": [
                        {
                          "selection": {
                            "directReference": {
                              "structField": {
                                "field": 1
                              }
                            }
                          }
                        }
                      ],
                      "outputType": {
      
                      }
                    }
                  }
                ]
              }
            }
          }
        ]
      }
      ')
      

      Attachments

        Issue Links

          Activity

            People

              paleolimbot Dewey Dunnington
              paleolimbot Dewey Dunnington
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h