Explorar o código

Merge pull request #6657 from ghalliday/issue11639

HPCC-11639 Don't include file positions on WU results written to disk

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=10) %!d(string=hai) anos
pai
achega
143ac69b6d

+ 2 - 1
common/fileview2/fvdisksource.cpp

@@ -227,7 +227,8 @@ bool DirectDiskDataSource::init()
     if (!transformedMeta)
         transformedMeta.set(returnedMeta);
 
-    addFileposition();
+    if (!isWorkunitResult())
+        addFileposition();
     physical.init(df);
     if (diskMeta->isFixedSize())
     {

+ 3 - 0
common/fileview2/fvdisksource.ipp

@@ -71,6 +71,7 @@ public:
     virtual void onClose();
     virtual bool fetchRowData(MemoryBuffer & out, __int64 offset);
     virtual bool isIndex() { return false; }
+    virtual bool isWorkunitResult() const { return false; }
 
 protected:
     size32_t getCopyLength();
@@ -133,6 +134,8 @@ class WorkunitDiskDataSource : public DirectDiskDataSource
 public:
     WorkunitDiskDataSource(const char * _logicalName, IConstWUResult * _wuResult, const char * _wuid, const char * _username, const char * _password);
 
+    virtual bool isWorkunitResult() const { return true; }
+
     virtual bool init();
 };
 

+ 4 - 4
testing/regress/ecl/key/outputresultfile.xml

@@ -1,6 +1,6 @@
 <Dataset name='x'>
- <Row><line>This</line><__fileposition__>0</__fileposition__></Row>
- <Row><line>is</line><__fileposition__>8</__fileposition__></Row>
- <Row><line>the</line><__fileposition__>14</__fileposition__></Row>
- <Row><line>result</line><__fileposition__>21</__fileposition__></Row>
+ <Row><line>This</line></Row>
+ <Row><line>is</line></Row>
+ <Row><line>the</line></Row>
+ <Row><line>result</line></Row>
 </Dataset>

+ 4 - 4
testing/regress/ecl/key/wuread3.xml

@@ -1,8 +1,8 @@
 <Dataset name='Names'>
- <Row><surname>Halliday            </surname><forename>Gavin     </forename><age>31</age><__fileposition__>0</__fileposition__></Row>
- <Row><surname>Halliday            </surname><forename>Liz       </forename><age>30</age><__fileposition__>32</__fileposition__></Row>
- <Row><surname>Salter              </surname><forename>Abi       </forename><age>10</age><__fileposition__>64</__fileposition__></Row>
- <Row><surname>X                   </surname><forename>Z         </forename><age>25</age><__fileposition__>96</__fileposition__></Row>
+ <Row><surname>Halliday            </surname><forename>Gavin     </forename><age>31</age></Row>
+ <Row><surname>Halliday            </surname><forename>Liz       </forename><age>30</age></Row>
+ <Row><surname>Salter              </surname><forename>Abi       </forename><age>10</age></Row>
+ <Row><surname>X                   </surname><forename>Z         </forename><age>25</age></Row>
 </Dataset>
 <Dataset name='Result 2'>
  <Row><surname>Halliday            </surname><forename>Gavin     </forename><age>31</age></Row>

+ 10 - 10
testing/regress/ecl/key/wuread4.xml

@@ -1,16 +1,16 @@
 <Dataset name='names'>
- <Row><i>1</i><str>one  </str><__fileposition__>0</__fileposition__></Row>
- <Row><i>4</i><str>four </str><__fileposition__>6</__fileposition__></Row>
- <Row><i>7</i><str>seven</str><__fileposition__>12</__fileposition__></Row>
- <Row><i>8</i><str>eight</str><__fileposition__>18</__fileposition__></Row>
- <Row><i>9</i><str>nine </str><__fileposition__>24</__fileposition__></Row>
+ <Row><i>1</i><str>one  </str></Row>
+ <Row><i>4</i><str>four </str></Row>
+ <Row><i>7</i><str>seven</str></Row>
+ <Row><i>8</i><str>eight</str></Row>
+ <Row><i>9</i><str>nine </str></Row>
 </Dataset>
 <Dataset name='namesClone'>
- <Row><i>1</i><str>one  </str><__fileposition__>0</__fileposition__></Row>
- <Row><i>4</i><str>four </str><__fileposition__>6</__fileposition__></Row>
- <Row><i>7</i><str>seven</str><__fileposition__>12</__fileposition__></Row>
- <Row><i>8</i><str>eight</str><__fileposition__>18</__fileposition__></Row>
- <Row><i>9</i><str>nine </str><__fileposition__>24</__fileposition__></Row>
+ <Row><i>1</i><str>one  </str></Row>
+ <Row><i>4</i><str>four </str></Row>
+ <Row><i>7</i><str>seven</str></Row>
+ <Row><i>8</i><str>eight</str></Row>
+ <Row><i>9</i><str>nine </str></Row>
 </Dataset>
 <Dataset name='Result 3'>
  <Row><i>2</i><str>four </str></Row>