Hi Jess,

In most cases the internal representation of date objects in the Enumerable
convention are longs [1].
Keep in mind that there are also other cases (e.g., [2]) where there are
conversion of dates to other types.

Best,
Stamatis

[1]
https://github.com/apache/calcite/blob/35c5f57d7db2b4745086178602ca69195ffb858e/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java#L193
[2]
https://github.com/apache/calcite/blob/35c5f57d7db2b4745086178602ca69195ffb858e/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java#L243


On Fri, Oct 4, 2019 at 5:26 PM Jess Balint <jbal...@gmail.com> wrote:

> I'm returning string objects from my enumerable, but getting an exception
> when trying to use the MONTH function which compiles to:
>
>
>
> org.apache.calcite.avatica.util.DateTimeUtils.unixDateExtract(org.apache.calcite.avatica.util.TimeUnitRange.MONTH,
> org.apache.calcite.runtime.SqlFunctions.toInt(current[1]))};
>
> current[1] is a string here and an exception is thrown. are dates expected
> to be java.util.Date objects? Is there documentation on this?
>
> Thanks.
>
> Jess
>

Reply via email to