Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-307

Implement CAST between date-time types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      See test case in misc.oq. Throws the following:

      java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
      	at net.hydromatic.optiq.runtime.AbstractCursor$IntAccessor.getInt(AbstractCursor.java:452)
      	at net.hydromatic.optiq.runtime.AbstractCursor$DateFromIntAccessor.getString(AbstractCursor.java:720)
      	at net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:205)
      

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.2.0-incubating (2015-04-16)

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.2.0-incubating (2015-04-16)
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/38a4dd41 .
        Hide
        julianhyde Julian Hyde added a comment -

        Implement cast between date-time types, e.g. CAST(aTimestamp AS DATE), CAST(aTime AS TIMESTAMP).

        When you cast a TIME to a TIMESTAMP it should yield a time in the current day (per CURRENT_DATE).

        Also be careful to round down when dealing with timestamps before the epoch (which are represented as negative numbers).

        Show
        julianhyde Julian Hyde added a comment - Implement cast between date-time types, e.g. CAST(aTimestamp AS DATE), CAST(aTime AS TIMESTAMP). When you cast a TIME to a TIMESTAMP it should yield a time in the current day (per CURRENT_DATE). Also be careful to round down when dealing with timestamps before the epoch (which are represented as negative numbers).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            julianhyde Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development