To define a custom function, you first write its implementation in Java and then compile it . The custom function implementation can exist in a single or multiple Java class files. A single Java class file can contain implementations of multiple custom functions.