Explorar o código

Merge pull request #9567 from afishbeck/roxiepipeTest

HPCC-16827 Add regression test for roxiepipe

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

+ 11 - 0
testing/regress/ecl/key/roxiepipe.xml

@@ -0,0 +1,11 @@
+<Dataset name='Result 1'>
+ <Row><name><first>Joe       </first><last>Doe            </last></name><address><city>Fresno    </city><state>CA</state><zipcode>11111</zipcode></address></Row>
+ <Row><name><first>Jason     </first><last>Jones          </last></name><address><city>Tempe     </city><state>AZ</state><zipcode>22222</zipcode></address></Row>
+ <Row><name><first>Becky     </first><last>Lopez          </last></name><address><city>New York  </city><state>NY</state><zipcode>33333</zipcode></address></Row>
+ <Row><name><first>Roderic   </first><last>Lykke          </last></name><address><city>Lubbock   </city><state>TX</state><zipcode>44444</zipcode></address></Row>
+ <Row><name><first>Rina      </first><last>Yonkers        </last></name><address><city>Denver    </city><state>CO</state><zipcode>55555</zipcode></address></Row>
+ <Row><name><first>Laverna   </first><last>Campa          </last></name><address><city>Detroit   </city><state>MI</state><zipcode>66666</zipcode></address></Row>
+ <Row><name><first>Shantell  </first><last>Mattera        </last></name><address><city>Toledo    </city><state>OH</state><zipcode>77777</zipcode></address></Row>
+ <Row><name><first>John      </first><last>Smith          </last></name><address><city>Boise     </city><state>ID</state><zipcode>88888</zipcode></address></Row>
+ <Row><name><first>Jane      </first><last>Smith          </last></name><address><city>Smallville</city><state>KY</state><zipcode>99999</zipcode></address></Row>
+</Dataset>

+ 58 - 0
testing/regress/ecl/roxiepipe.ecl

@@ -0,0 +1,58 @@
+//nothor
+//nohthor
+
+NameRec := RECORD
+  string10 First;
+  string15 Last;
+END;
+
+AddressRec := RECORD
+  string10 City;
+  string2 State;
+  integer4 ZipCode;
+END;
+
+PersonRec := RECORD
+  NameRec Name;
+  AddressRec Address;
+END;
+
+pipe_send := DATASET([{{'Joe', 'Doe'}, {'Fresno', 'CA', 11111}},
+{{'Jason', 'Jones'}, {'Tempe', 'AZ', 22222}},
+{{'Becky', 'Lopez'}, {'New York', 'NY', 33333}},
+{{'Roderic', 'Lykke'}, {'Lubbock', 'TX', 44444}},
+{{'Rina', 'Yonkers'}, {'Denver', 'CO', 55555}},
+{{'Laverna', 'Campa'}, {'Detroit', 'MI', 66666}},
+{{'Shantell', 'Mattera'}, {'Toledo', 'OH', 77777}},
+{{'John', 'Smith'}, {'Boise', 'ID', 88888}},
+{{'Jane','Smith'}, {'Smallville', 'KY', 99999}}], PersonRec);
+
+/*  NOTES:
+	roxiepipe = the executable we're calling
+	iw = Input Width
+	vip = Virtual IP
+	t = # threads
+	ow = output width
+	b = # records in a batch
+	mr = max retries
+	h = ??? -- the URL to the Roxie batch service
+	r = name of the results dataset (case sensitive!)
+	q = query
+*/
+
+
+// This is the remote call to the 'roxie_echo' service.
+pipe_recv := PIPE(pipe_send,
+    'roxiepipe' +
+    ' -iw ' + SIZEOF(PersonRec) +
+    ' -t 1' +
+    ' -ow ' + SIZEOF(PersonRec) +
+    ' -b 3' +
+    ' -mr 2' +
+    ' -h .:9876 ' +
+    ' -r Peeps' +
+    ' -q "<roxie_echo format=\'raw\'><peeps id=\'id\' format=\'raw\'></peeps></roxie_echo>"'
+, PersonRec);
+
+OUTPUT(pipe_recv);
+

+ 24 - 0
testing/regress/ecl/setup/roxie_echo.ecl

@@ -0,0 +1,24 @@
+//nothor
+//nohthor
+//publish
+
+NameRec := RECORD
+  string10 First;
+  string15 Last;
+END;
+
+AddressRec := RECORD
+  string10 City;
+  string2 State;
+  integer4 ZipCode;
+END;
+
+PersonRec := RECORD
+  NameRec Name;
+  AddressRec Address;
+END;
+
+peeps := DATASET([], PersonRec) : STORED('peeps', FEW);
+
+OUTPUT(peeps, NAMED('Peeps'));
+