@Override
  public RelDataType toSql(RelDataType type) {
    return convertToSql(this, type);
  }
Calcite does validation of projected field types in select statement with the output schema types. If one of the
projected fields is an UDF with return type of {@link Object} or any other java type not defined in
{@link JavaToSqlTypeConversionRules}, using the default {@link JavaTypeFactoryImpl} results in validation failure.
Hence, extending {@link JavaTypeFactoryImpl} to make Calcite validation work with all output types of Samza SQL UDFs.
samza-sql/src/main/java/org/apache/samza/sql/interfaces/SamzaSqlJavaTypeFactoryImpl.java