calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hongbin ma <mahong...@apache.org>
Subject Re: how to get EXTRACT function working in CSVTest
Date Fri, 10 Feb 2017 06:08:19 GMT
thanks Julian.

I have created a JIRA https://issues.apache.org/jira/browse/CALCITE-1629


On Thu, Feb 9, 2017 at 4:19 AM, Julian Hyde <jhyde@apache.org> wrote:

> Please log a bug for this.
>
> You’re running into the problem I feared when I wrote "I'd rather that we
> convert java.sql.Date values when they enter the system” in
> https://issues.apache.org/jira/browse/CALCITE-1569 <
> https://issues.apache.org/jira/browse/CALCITE-1569>. EXTRACT needs its
> input to be in internal format, which is a long (or Long) for a TIMESTAMP,
> an int (or Integer) for a DATE or TIME.
>
> Julian
>
>
> > On Feb 7, 2017, at 11:02 PM, hongbin ma <mahongbin@apache.org> wrote:
> >
> > hi experts,
> >
> > According to this doc https://calcite.apache.org/docs/reference.html the
> > EXTRACT function should work in Calcite. So I'm trying a query with
> EXTRACT
> > in CSVTest:
> >
> > @Test public void testSelectx() throws SQLException {
> >  checkSql("model", "select extract(year from JOINEDAT) from EMPS ");
> > }
> >
> > the query failed due to:
> >
> > java.lang.ClassCastException: java.sql.Date cannot be cast to
> > java.lang.Integer
> >
> > I also tried to change column JOINDAT's type to timestamp and datetime,
> but
> > end up with similar exceptions.
> >
> > Can you please help here? thx
> >
> >
> > --
> > Regards,
> >
> > *Bin Mahone | 马洪宾*
>
>


-- 
Regards,

*Bin Mahone | 马洪宾*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message