Skip to content

Function Matching Rules for UDFs

Paul Rogers edited this page Jan 8, 2018 · 1 revision

Rules of Thumb

Given the type conversion rules, we can get the most bang out of our UDFs if we do the following:

  • For simple UDFs, allow Drill to do null handling. (For aggregates, we must do it.) Drill will then pass our function only non-nullable holders.
  • Choose the Float8 type (simple) or NullableFloat8 type (aggregates) for arguments as it will work with any of Drill's integral of floating point types (Drill do any necessary conversion.)
  • If the argument is best defined as an integer, choose BigInt as it will work for all integral types (including the BigInt type used for JSON integers.)
Clone this wiki locally