Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-857

Transform should produce objects in the same type as specified at runtime

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4.0
    • 0.4.1
    • Query Processor
    • None
    • Reviewed

    Description

      The following code fails at runtime, because the "clicked" field produced by "transform" is actually of type String at runtime, instead of boolean.

      INSERT OVERWRITE TABLE feature_index
      SELECT
       temp.feature,
       temp.ad_id,
       sum(if(temp.clicked, 1, 0)) / cast(count(temp.clicked) as DOUBLE) as clicked_percent
      FROM (
       SELECT concat('ua:', trim(lower(ua.feature))) as feature, ua.ad_id, ua.clicked
       FROM (
        MAP raw_logs.user_agent, raw_logs.ad_id, raw_logs.clicked
        USING 'my.py' as (feature STRING, ad_id STRING, clicked BOOLEAN)
        FROM raw_logs
       ) ua
      ) temp
      GROUP BY temp.feature, temp.ad_id;
      

      Attachments

        1. HIVE-857.1.patch
          129 kB
          Zheng Shao

        Activity

          People

            zshao Zheng Shao
            zshao Zheng Shao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: