Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.10.0
-
Description
I defined as ScalarFunction as follow:
public class DateFunc extends ScalarFunction { public String eval(Date date) { return date.toString(); } @Override public TypeInformation<?> getResultType(Class<?>[] signature) { return Types.STRING; } @Override public TypeInformation<?>[] getParameterTypes(Class<?>[] signature) { return new TypeInformation[]{Types.INT}; } }
I ues it in sql: `select func(DATE '2020-11-12') as a from source` , Flink throws 'cannot cast 2020-11-12 as class java.time.LocalDate '
The full code is in the Flinktest.zip Main class is com.lorinda.template.TestDateFunction
Attachments
Attachments
Issue Links
- links to