richtia commented on PR #14143:
URL: https://github.com/apache/arrow/pull/14143#issuecomment-1248830754

   @westonpace 
   Here's another one with multiple functions.
   
   SQL
   ```
   SELECT PS_AVAILQTY
   FROM 'partsupp'
   WHERE PS_AVAILQTY < 10
   ```
   
   Substrait Plan:
   ```
   {
     "extensions": [
       {
         "extensionFunction": {
           "functionAnchor": 1,
           "name": "lt"
         }
       },
       {
         "extensionFunction": {
           "functionAnchor": 2,
           "name": "is_not_null"
         }
       },
       {
         "extensionFunction": {
           "functionAnchor": 3,
           "name": "and"
         }
       }
     ],
     "relations": [
       {
         "root": {
           "input": {
             "project": {
               "input": {
                 "read": {
                   "baseSchema": {
                     "names": [
                       "ps_partkey",
                       "ps_suppkey",
                       "ps_availqty",
                       "ps_supplycost",
                       "ps_comment"
                     ],
                     "struct": {
                       "types": [
                         {
                           "i32": {
                             "nullability": "NULLABILITY_NULLABLE"
                           }
                         },
                         {
                           "i32": {
                             "nullability": "NULLABILITY_NULLABLE"
                           }
                         },
                         {
                           "i32": {
                             "nullability": "NULLABILITY_NULLABLE"
                           }
                         },
                         {
                           "decimal": {
                             "scale": 2,
                             "precision": 15,
                             "nullability": "NULLABILITY_NULLABLE"
                           }
                         },
                         {
                           "varchar": {
                             "length": 198,
                             "nullability": "NULLABILITY_NULLABLE"
                           }
                         }
                       ],
                       "nullability": "NULLABILITY_REQUIRED"
                     }
                   },
                   "filter": {
                     "scalarFunction": {
                       "functionReference": 3,
                       "outputType": {
                         "bool": {
                           "nullability": "NULLABILITY_NULLABLE"
                         }
                       },
                       "arguments": [
                         {
                           "value": {
                             "scalarFunction": {
                               "functionReference": 1,
                               "outputType": {
                                 "i32": {
                                   "nullability": "NULLABILITY_NULLABLE"
                                 }
                               },
                               "arguments": [
                                 {
                                   "value": {
                                     "selection": {
                                       "directReference": {
                                         "structField": {
                                           "field": 2
                                         }
                                       },
                                       "rootReference": {}
                                     }
                                   }
                                 },
                                 {
                                   "value": {
                                     "literal": {
                                       "i32": 10
                                     }
                                   }
                                 }
                               ]
                             }
                           }
                         },
                         {
                           "value": {
                             "scalarFunction": {
                               "functionReference": 2,
                               "outputType": {
                                 "i32": {
                                   "nullability": "NULLABILITY_NULLABLE"
                                 }
                               },
                               "arguments": [
                                 {
                                   "value": {
                                     "selection": {
                                       "directReference": {
                                         "structField": {
                                           "field": 2
                                         }
                                       },
                                       "rootReference": {}
                                     }
                                   }
                                 }
                               ]
                             }
                           }
                         }
                       ]
                     }
                   },
                   "projection": {
                     "select": {
                       "structItems": [
                         {
                           "field": 2
                         }
                       ]
                     },
                     "maintainSingularStruct": true
                   },
                   "namedTable": {
                     "names": [
                       "partsupp"
                     ]
                   }
                 }
               },
               "expressions": [
                 {
                   "selection": {
                     "directReference": {
                       "structField": {}
                     },
                     "rootReference": {}
                   }
                 }
               ]
             }
           },
           "names": [
             "ps_availqty"
           ]
         }
       }
     ]
   }
   ```


-- 
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