Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4165

HBase translator - time values are not translated correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 9.0
    • 8.12.x
    • Misc. Connectors
    • None
    • Hide

      DDL:

      CREATE FOREIGN TABLE SmallA (
          ...
          TimeValue time OPTIONS (NATIVE_TYPE 'time', NAMEINSOURCE 'timevalue'),
          ...
      CREATE VIEW SmallA (
          ...
          TimeValue time,
          ....
        AS
        SELECT ... TimeValue, ...
      

      Query:

      SELECT IntKey FROM Source.SmallA WHERE Source.SmallA.TimeValue IN (convert('05:00:00', time), convert('15:00:00', time))
      SELECT IntKey FROM Source.SmallA WHERE Source.SmallA.TimeValue IN ({t '05:00:00'}, {t '15:00:00'})
      

      Source-specific command:

      SELECT g_0.intkey FROM smalla AS g_0 WHERE g_0.timevalue IN (TIME '1970-01-01 05:00:00.0', TIME '1970-01-01 15:00:00.0')
      
      Show
      DDL: CREATE FOREIGN TABLE SmallA ( ... TimeValue time OPTIONS (NATIVE_TYPE ' time ' , NAMEINSOURCE 'timevalue' ), ... CREATE VIEW SmallA ( ... TimeValue time , .... AS SELECT ... TimeValue, ... Query: SELECT IntKey FROM Source .SmallA WHERE Source .SmallA.TimeValue IN ( convert ( '05:00:00' , time ), convert ( '15:00:00' , time )) SELECT IntKey FROM Source .SmallA WHERE Source .SmallA.TimeValue IN ({t '05:00:00' }, {t '15:00:00' }) Source-specific command: SELECT g_0.intkey FROM smalla AS g_0 WHERE g_0.timevalue IN ( TIME '1970-01-01 05:00:00.0' , TIME '1970-01-01 15:00:00.0' )

    Description

      HBase translator rewrites time values (e.g. {t '15:00:00'}) as TIME '1970-01-01 15:00:00.0'. But HBase stores time values with base date 1900-01-01....

      Updated source-specific commands returns correct result.

      SELECT g_0.intkey FROM smalla AS g_0 WHERE g_0.timevalue IN (TIME '1900-01-01 05:00:00.0', TIME '1900-01-01 15:00:00.0')
      

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            jdurani Juraj DurĂ¡ni (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: