Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-17999

Roxie query using OUTPUT(..., extend) generates invalid JSON

    XMLWordPrintable

    Details

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

      Description

      In testing the Visualization Framework...

      See http://52.51.90.23:8010/# on the open web.
      This shows HPCC version "6.2.18-1".
      Published queries "ie_pop" and "ie_pop_test". (These are Gordon Smith's examples from http://bl.ocks.org/GordonSmith/e861d41a234c35cfceb6.)

      When published as Roxie, http://52.51.90.23:8002/WsEcl/submit/query/roxie/ie_pop_test.1/json?jsonp=jsonp_callback_680422&pop_type=male
      ...returns:
      ========================
      jsonp_callback_680422({"ie_pop_test.1Response": {"sequence": 0, "Results": {"ie_population": {"Row": [

      {"location": "Carlow", "total": 27431}

      ,

      {"location": "Dublin City", "total": 257303}

      ,

      {"location": "Dun Laoghaire-Rathdown", "total": 98567}

      ,

      {"location": "Fingal", "total": 134488}

      ,

      {"location": "South Dublin", "total": 129544}

      ,

      {"location": "Kildare", "total": 104658}

      ,

      {"location": "Kilkenny", "total": 47788}

      ,

      {"location": "Laoighis", "total": 40587}

      ]"Row": [

      {"location": "Longford", "total": 19649}

      ,

      {"location": "Louth", "total": 60763}

      ,

      {"location": "Meath", "total": 91910}

      ,

      {"location": "Offaly", "total": 38430}

      ,

      {"location": "Westmeath", "total": 42783}

      ,

      {"location": "Wexford", "total": 71909}

      ,

      {"location": "Wicklow", "total": 67542}

      ,

      {"location": "Clare", "total": 58298}

      ,

      {"location": "Cork City", "total": 58812}

      ,

      {"location": "Cork County", "total": 198658}

      ,

      {"location": "Kerry", "total": 72628}

      ,

      {"location": "Limerick City", "total": 27947}

      ,

      {"location": "Limerick County", "total": 67868}

      ,

      {"location": "North Tipperary", "total": 35340}

      ,

      {"location": "South Tipperary", "total": 44244}

      ,

      {"location": "Waterford City", "total": 22921}

      ,

      {"location": "Waterford County", "total": 33543}

      ,

      {"location": "Galway City", "total": 36514}

      ,

      {"location": "Galway County", "total": 88244}

      ,

      {"location": "Leitrim", "total": 16144}

      ,

      {"location": "Mayo", "total": 65420}

      ,

      {"location": "Roscommon", "total": 32353}

      ,

      {"location": "Sligo", "total": 32435}

      ,

      {"location": "Cavan", "total": 37013}

      ,

      {"location": "Donegal", "total": 80523}

      ,

      {"location": "Monaghan", "total": 30441}

      ]}}}});
      ========================

      Note:
      ...Laoighis", "total": 40587}]"Row": [{"location"...
      (Nothing between the close ] and "Row".)

      When published to hthor, then http://52.51.90.23:8002/WsEcl/submit/query/hthor/ie_pop_test.1/json?jsonp=jsonp_callback_680422&pop_type=male
      ...returns:

      ========================
      jsonp_callback_680422({"ie_pop_test.1Response": {
      "Results": {
      "ie_population": {"Row": [

      {"location": "Carlow", "total": 27431}

      ,

      {"location": "Dublin City", "total": 257303}

      ,

      {"location": "Dun Laoghaire-Rathdown", "total": 98567}

      ,

      {"location": "Fingal", "total": 134488}

      ,

      {"location": "South Dublin", "total": 129544}

      ,

      {"location": "Kildare", "total": 104658}

      ,

      {"location": "Kilkenny", "total": 47788}

      ,

      {"location": "Laoighis", "total": 40587}

      ,

      {"location": "Longford", "total": 19649}

      ,

      {"location": "Louth", "total": 60763}

      ,

      {"location": "Meath", "total": 91910}

      ,

      {"location": "Offaly", "total": 38430}

      ,

      {"location": "Westmeath", "total": 42783}

      ,

      {"location": "Wexford", "total": 71909}

      ,

      {"location": "Wicklow", "total": 67542}

      ,

      {"location": "Clare", "total": 58298}

      ,

      {"location": "Cork City", "total": 58812}

      ,

      {"location": "Cork County", "total": 198658}

      ,

      {"location": "Kerry", "total": 72628}

      ,

      {"location": "Limerick City", "total": 27947}

      ,

      {"location": "Limerick County", "total": 67868}

      ,

      {"location": "North Tipperary", "total": 35340}

      ,

      {"location": "South Tipperary", "total": 44244}

      ,

      {"location": "Waterford City", "total": 22921}

      ,

      {"location": "Waterford County", "total": 33543}

      ,

      {"location": "Galway City", "total": 36514}

      ,

      {"location": "Galway County", "total": 88244}

      ,

      {"location": "Leitrim", "total": 16144}

      ,

      {"location": "Mayo", "total": 65420}

      ,

      {"location": "Roscommon", "total": 32353}

      ,

      {"location": "Sligo", "total": 32435}

      ,

      {"location": "Cavan", "total": 37013}

      ,

      {"location": "Donegal", "total": 80523}

      ,

      {"location": "Monaghan", "total": 30441}

      ]}}}});
      ========================

      I.e., there is a single "Row" element, multiple children.

      Browsers calling this Roxie version generate this error when parsing the JSON:
      SyntaxError: missing } after property list

      The hthor version, with the same code, does not.

      Note the ECL is identical for both roxie and hthor pub'd queries and includes "extend" named outputs:
      output(project(d1, totTrans(LEFT)), named('ie_population'), extend);
      output(project(d2, totTrans(LEFT)), named('ie_population'), extend);

      In Gordon's original code, there is no "extend" and it works fine on Roxie.
      The "extend" seems to generate two separate JSON clauses, without inserting the proper delimiters between.

      Summary: the "extend" seems to generate the issue, and on Roxie but not on Hthor.
      I have not tested other scenarios.

      (This also exists back on 5.2.4.)

        Attachments

          Activity

            People

            • Assignee:
              afishbeck Anthony Fishbeck
              Reporter:
              jwilt James Wiltshire
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: