Hmm, I am not sure do we need such kind of logic to handle different input

Besides the use case I list in the javadoc, another possible case is that 1 team generates the term frequency and output to HDFS and another team reads the term frequency and generates entropy based on that. In this case, the entropy UDF indeed handles input maybe not explicit long or int, but bytearray or chararray.