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

Add MILLISECOND in TimeUnit

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • None
    • None

    Description

      select interval_day_time('2 1:2:3') from src limit 1;
      

      Hive supports sub-millisecond intervals, i.e., nano-seconds. For example, Hive will translate this into a RexLiteral of
      176523000.000000, which is the millisecond representation of "2 1:2:3".
      Then when it goes through the ReduceExpressionRule, RexReplacer will call
      RexBuilder to make a cast. And in the L527 of RexBuilder, the value of
      176523000.000000 will be divided by the multiplier and becomes the new
      value. However, Hive does not want any multiplier as it is already in
      millisecond format. Thus, a candidate solution here is to add a millisecond time unit and make its multiplier as 1.

      Attachments

        1. CALCITE-1020.01.patch
          0.8 kB
          Pengcheng Xiong

        Activity

          People

            julianhyde Julian Hyde
            pxiong Pengcheng Xiong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: