Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-978

RoundFloat8 should return Float8Datum type.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently RoundFloat8 function returns TextDatum. So the following query occurs InvalidOperationException.

       select * from (
          select n_nationkey as key, 
                    case when n_nationkey < 6 
                        then round((n_nationkey * 100 / 2.123)::float4 / (n_regionkey + 1)::float4, 2) 
                        else 100.0 
                    end as val 
            from nation) a 
      order by a.key
      
      2014-07-25 16:40:08,418 ERROR: org.apache.tajo.worker.Task (run(432)) - Cannot compare to FLOAT8 type datum
      org.apache.tajo.exception.InvalidOperationException: Cannot compare to FLOAT8 type datum
      	at org.apache.tajo.datum.TextDatum.compareTo(TextDatum.java:113)
      	at org.apache.tajo.storage.TableStatistics.analyzeField(TableStatistics.java:91)
      	at org.apache.tajo.storage.RawFile$RawFileAppender.addTuple(RawFile.java:600)
      	at org.apache.tajo.engine.planner.physical.RangeShuffleFileWriteExec.next(RangeShuffleFileWriteExec.java:101)
      	at org.apache.tajo.worker.Task.run(Task.java:425)
      	at org.apache.tajo.worker.TaskRunner$1.run(TaskRunner.java:406)
      	at java.lang.Thread.run(Thread.java:744)
      

        Attachments

          Activity

            People

            • Assignee:
              hjkim Hyoungjun Kim
              Reporter:
              hjkim Hyoungjun Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: