Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-3720

Nested concats of binary conditionals take 1/2 hour to parse

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.10.0
    • None
    • parser
    • None

    Description

      This statement takes over 1/2 hour to parse. Seems to be related to the conditionals. Removing them and just running the nested concats, it parses fast:

      fact_tsgsrtd_dim_hash = foreach tsgsrtd generate checksum,
      UPPER(
      CONCAT((no_of_rics == '
      N' ? '0' : no_of_rics),
      CONCAT(request_start_dttm,
      CONCAT(request_end_dttm,
      CONCAT((adjs_list == '
      N' ? 'UNKNOWN' : adjs_list),
      CONCAT((event_datatype == '
      N' ? 'UNKNOWN' : event_datatype),
      CONCAT((facts_list == '
      N' ? 'UNKNOWN' : facts_list),
      CONCAT((frequency == '
      N' ? 'UNKNOWN' : frequency),
      CONCAT((points == '
      N' ? '0' : points),
      CONCAT((multiplier == '
      N' ? '0' : multiplier),
      CONCAT((qos == '
      N' ? 'UNKNOWN' : qos),
      CONCAT((pe == '
      N' ? '0' : pe),
      (event_type == 'GSREQ' ? 'GS' : (event_type == 'RICREQ' ? 'RTD' : (event_type == 'TSREQ' ? 'TS' : 'UNKNOWN')))
      ))))))))))));

      I noticed it I split it, do half the conditionals in one relation, then take the results of that and create another relation and do the other half of the conditionals, it parses in less than a minute:

      fact_tsgsrtd_cat1 = foreach tsgsrtd generate checksum, points, multiplier, qos, pe, event_type,
      CONCAT(CONCAT((no_of_rics == '
      N' ? '0' : no_of_rics),'.000000000'),
      CONCAT(request_start_dttm,
      CONCAT(request_end_dttm,
      CONCAT((adjs_list == '
      N' ? 'UNKNOWN' : adjs_list),
      CONCAT((event_datatype == '
      N' ? 'UNKNOWN' : event_datatype),
      CONCAT((facts_list == '
      N' ? 'UNKNOWN' : facts_list),
      (frequency == '
      N' ? 'UNKNOWN' : frequency)
      )))))) as cat1;

      fact_tsgsrtd_dim_hash = foreach fact_tsgsrtd_cat1 generate checksum,
      UPPER(
      CONCAT(cat1,
      CONCAT((points == '
      N' ? '0' : points),
      CONCAT((multiplier == '
      N' ? '0' : multiplier),
      CONCAT((qos == '
      N' ? 'UNKNOWN' : qos),
      CONCAT(CONCAT((pe == '
      N' ? '0' : pe), '.0000'),
      (event_type == 'GSREQ' ? 'GS' : (event_type == 'RICREQ' ? 'RTD' : (event_type == 'TSREQ' ? 'TS' : 'UNKNOWN')))
      )))))) as ts_dim_hash;

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            steve.ogden@thomsonreuters.com Steve Ogden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment