thisisnic opened a new issue, #34305:
URL: https://github.com/apache/arrow/issues/34305

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   I'm writing bindings in substrait-r for the Substrait `extract()` function.  
When I try to run this in Acero, I get the error shown at the bottom of the 
example R code below.
   
   ```
   tbl <- tibble::tibble(x = as.Date("1987-10-09"))
   temp_parquet <- tempfile()
   arrow::write_parquet(tbl, temp_parquet)
   
   plan_json <- sprintf('{
     "extensionUris": [
       {
         "extensionUriAnchor": 1,
         "uri": 
"https://github.com/substrait-io/substrait/blob/main/extensions/functions_arithmetic.yaml";
       },
       {
         "extensionUriAnchor": 2,
         "uri": 
"https://github.com/substrait-io/substrait/blob/main/extensions/functions_comparison.yaml";
       }
     ],
     "extensions": [
       {
         "extensionFunction": {
           "functionAnchor": 2,
           "name": "extract"
         }
       }
     ],
     "relations": [
       {
         "rel": {
           "project": {
             "common": {
   
             },
             "input": {
               "read": {
                 "baseSchema": {
                   "names": [
                     "x"
                   ],
                   "struct": {
                     "types": [
                       {
                         "date": {
                           "nullability": "NULLABILITY_NULLABLE"
                         }
                       }
                     ]
                   }
                 },
                 "localFiles": {
                   "items": [
                     {
                       "uriFile": "file://%s",
                       "parquet": {
   
                       }
                     }
                   ]
                 }
               }
             },
             "expressions": [
               {
                 "scalarFunction": {
                   "functionReference": 2,
                   "outputType": {
                     "i64": {
                       "nullability": "NULLABILITY_NULLABLE"
                     }
                   },
                   "arguments": [
                     {
                       "value": {
                         "selection": {
                           "directReference": {
                             "structField": {
   
                             }
                           },
                           "rootReference": {
   
                           }
                         }
                       }
                     }
                   ],
                   "options": [
                     {
                       "name": "component",
                       "preference": [
                         "YEAR"
                       ]
                     }
                   ]
                 }
               }
             ]
           }
         }
       }
     ]
   }', temp_parquet)
   
   arrow:::do_exec_plan_substrait(plan_json)
   #> Error: Invalid: Expected Substrait call to have an enum argument at index 
0 but the argument was not an enum.
   #> 
/Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/engine/substrait/extension_set.cc:754
  call.GetEnumArg(arg_index)
   #> 
/Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/engine/substrait/extension_set.cc:875
  ParseEnumArg(call, 0, kTemporalComponentParser)
   #> 
/Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/engine/substrait/relation_internal.cc:549
  FromProto(expr, ext_set, conversion_options)
   #> 
/Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/engine/substrait/serde.cc:160 
 FromProto(plan_rel.has_root() ? plan_rel.root().input() : plan_rel.rel(), 
ext_set, conversion_options)
   
   ```
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to