Skip to content

Built-in UDF

Abstract

The punch provides you with some built-in user defined functions. These can be registered and made available to your SQL statements.

  1. punch_str_to_array_double(param1)
param1: String -> param1 is a String which follows the format: "[1, 2.0, 5.6]"

return a List<Double>
  1. punch_kmeans_sqdist(param1, param2, param3, param4)
param1: WrappedArray<Double> -> param1 is a WrappedArray<Double> -> features
param2: Integer -> param2 is an Integer -> prediction
param3: String -> param3 is a String -> model name 
    (it is expected that the model is loaded with our settings)
param4: Integer -> param4 is an Integer -> stage number

return a Double