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

ECL: allow Roxie to return empty XML tag for a ROW having non-string fields

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Code Generator
    • Labels:

      Description

      When record definition has field(s) of non-string type (say, integer), and query returns a ROW of such record, there's no easy way for Roxie to return an empty XML tag representing such ROW.

      There are few issues with that:
      1. It seems inconsistent, since we can do this with datasets; simple ds:=[] will do, even if dataset contain such rows.
      2. It is not possible to tell the difference between "didn't find" data and "didn't try to find"; in both cases integral fields will be returned as sub-tags with a default value.
      3. Non-empty XML tag can be treated by a client as indication of certain query activity; bad practice, but happens anyway: at this very moment we have to implement a awkward solution on ESP side to handle such case.

      Sample query code:
      /*-SOAP-
      <message name="test_service">
      <part name="abc" type="xsd:byte"/> </message> */

      export test_service() := macro
      abc:= 0 : stored ('abc');

      rec := record
      integer i; //if change to a string type, then blank xml tag can be returned
      string t;
      end;

      rec_result := record
      integer k;
      rec r;
      dataset (rec) ds_r;
      end;

      rec_result format () := transform
      Self.k := abc;
      Self.r := row ([], rec); // empty dataset[1] won't work either
      Self.ds_r := []; // works for datasets
      end;
      res := dataset ([format ()]);

      output (res, named('results'));
      endmacro;

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vmyullyari Vladimir Myullyari
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: