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

Don't output a line for empty file parts when despraying JSON file

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.16, 6.4.38
    • Component/s: DFU Server
    • Labels:
      None

      Description

      I wanted to despray a file that's a single JSON object. When I do this I get a file with a line for each file part (plus a header line), each one where there's no data containing just a comma. Could we have an option not to include these?

      ECL to reproduce:

      #WORKUNIT('name', 'JSON test');
      
      Layout := RECORD
        STRING20 process_str{XPATH('process')};
        STRING20 source;
      END;
           
      TempFilename := '~thor::tmp::jcw::json_test::' + WORKUNIT;
      
      WriteFile := OUTPUT(DATASET([{'test_process_1', 'test_source_1'}
                                  ], Layout)
                        ,
                        , TempFilename
                        , JSON('', HEADING('', ''), OPT, TRIM)
                        , EXPIRE(1)
                        , OVERWRITE
                        );
      
      DesprayFile := STD.File.Despray(TempFilename, _Control.ThisEnvironment.landingzone, '/data/jcw/json_test_' + WORKUNIT + '.json', allowoverwrite := TRUE);
      
      SEQUENTIAL(WriteFile, DesprayFile);
      

      Attached file showing the output from a 20-way cluster.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                attilavamos Attila Vamos
                Reporter:
                james.wilson James Wilson
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: