Hi Team , I have found that the working package fo...
# troubleshooting
d
Hi Team , I have found that the working package for @ScalarFunction should be
Copy code
org.apache.pinot.*.function.*
But In the Doc It is org.apache.pinot.scalar.XXXX Can Anyone say Is there a way of auto register package when the package is this 'org.apache.pinot.scalar.XXXX'?
Copy code
Or  org.apache.pinot.*.function.* this will be the actual package?
@Mayank Kindly verify this and update doc
s
@Deena Dhayalan / @Mayank i am trying to test the scalar function feature.. can you please help verify below code looks fine or do you see any issue with package name etc.
Copy code
package org.apache.pinot.scalar.udfpoc;


import java.util.concurrent.TimeUnit;
import org.apache.pinot.spi.annotations.ScalarFunction;


public class pinotudfpoc {

    private pinotudfpoc() {
    }

    @ScalarFunction
    public static long surajtoEpochSeconds(long millis) {
        return TimeUnit.MILLISECONDS.toSeconds(millis);
    }


    @ScalarFunction
    public static double surajdivide(double a, double b) {
        return a / b;
    }

    @ScalarFunction
    static String surajmySubStr(String input, Integer beginIndex) {
        return input.substring(beginIndex);
    }


}
d
Copy code
org.apache.pinot.udf.function.Scalar
Kindly Try this package