GitHub user arunmahadevan opened a pull request:
https://github.com/apache/storm/pull/1899
STORM-2330: Fix storm sql code generation for UDAF with non standard sql
types
Storm-sql uses cacite's code generator. For UDAF with non standard return
types, the generated code does not compile.
E.g. For an UDAF that returns a List<T> cacite converts the return type to
SQL type "OTHER" and finally inserts a cast to Object[] in the returned code
which fails to compile with "java.lang.ClassCastException: java.util.ArrayList
cannot be cast to [Ljava.lang.Object;"
Use a custom type factory to return "ANY" as the type (instead of OTHER) if
the java type cannot be mapped to a sql type.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/arunmahadevan/storm STORM-2330
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/1899.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1899
----
commit 1d09d786fdbf61f634441e76e2c2a53c35178540
Author: Arun Mahadevan <[email protected]>
Date: 2017-01-27T06:49:18Z
STORM-2330: Fix storm sql code generation for UDAF with non standard sql
types
Storm-sql uses cacite's code generator. For UDAF with non standard return
types, the generated code does not compile.
E.g. For an UDAF that returns a List<T> cacite converts the return type to
SQL type "OTHER" and finally inserts a cast to Object[] in the returned code
which fails to compile with "java.lang.ClassCastException: java.util.ArrayList
cannot be cast to [Ljava.lang.Object;"
Use a custom type factory to return "ANY" as the type (instead of OTHER) if
the java type cannot be mapped to a sql type.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---