Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-16077 Add option to download WU result in CSV format #9056

Merged
merged 1 commit into from
Sep 20, 2016

Conversation

wangkx
Copy link
Member

@wangkx wangkx commented Aug 31, 2016

The option can be used by WsWorkunits.WUResultBin.format = 'csv'.

Signed-off-by: wangkx kevin.wang@lexisnexis.com

@hpcc-jirabot
Copy link

@wangkx
Copy link
Member Author

wangkx commented Aug 31, 2016

@afishbeck please review

return;
}

if (!strieq(fieldName, "row"))
Copy link
Member

@afishbeck afishbeck Sep 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you can rely on the fieldname "row" not being used for other types of fields. And is this processing post xpath, where a row might have another name? i.e.

<Records>
<Record>

Rather than
<Records>
<Row>
?

@afishbeck
Copy link
Member

@wangkx I think I need to step through an example before I can continue much further.

@afishbeck
Copy link
Member

@wangkx testing looked ok when I didn't use xpaths on the datasets.. but I'll wait until you fix that (as we discussed) before continuing to review the code.

Here's some code I threw together to test. Take out all the XPATHs and run it once. I think it will work ok. Then run with the xpaths and debug. Notice the xpath('/Name').. that's a different variation then just renaming the 'Row'. If you need help let me know. You can look at the legacy eclwatch view to get a good idea of what it should look like.

`namerec := RECORD
string First {xpath('First')};
string Last {xpath('Last')};
END;

Addressrec := RECORD
string city {xpath('City')};
string zip {xpath('ZipCode')};
END;

bestrec := RECORD
namerec name {xpath('Name')};
addressrec address {xpath('Address')};
END;

Personrec := RECORD
bestrec best;
dataset(namerec) names {xpath('/Name')};
dataset(addressrec) addresses {xpath('Addresses/Address')};
dataset(namerec) Aliases;
END;

Peoplerec := RECORD
dataset(Personrec) addresses {xpath('Persons/Person')};
END;

ds := dataset([{[{{{'A', 'B'},{'C', 'Z'}}, [{'Aa', 'Bb'},{'Ab', 'Bc'},{'Ac', 'Bd'}], [{'C1', 'Z1'},{'C2', 'Z2'},{'C3', 'Z2'}], [{'Aa', 'Bb'},{'Ab', 'Bc'},{'Ac', 'Bd'}]},{{{'A', 'B'},{'C', 'Z'}}, [{'Aa', 'Bb'},{'Ab', 'Bc'},{'Ac', 'Bd'}], [{'C1', 'Z1'},{'C2', 'Z2'},{'C3', 'Z2'}], [{'Aa', 'Bb'},{'Ab', 'Bc'},{'Ac', 'Bd'}]},{{{'A', 'B'},{'C', 'Z'}}, [{'Aa', 'Bb'},{'Ab', 'Bc'},{'Ac', 'Bd'}], [{'C1', 'Z1'},{'C2', 'Z2'},{'C3', 'Z2'}], [{'Aa', 'Bb'},{'Ab', 'Bc'},{'Ac', 'Bd'}]}]}], Peoplerec);

output(ds, named('People'));`

@wangkx
Copy link
Member Author

wangkx commented Sep 13, 2016

The latest code should handle both xpath and no xpath. It still needs to be cleaned.

@richardkchapman
Copy link
Member

@afishbeck Please re-review

@afishbeck
Copy link
Member

@wangkx Let me know when you've finished the changes you mentioned.

The option can be used by WsWorkunits.WUResultBin.format = 'csv'.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
@wangkx
Copy link
Member Author

wangkx commented Sep 16, 2016

@afishbeck the code has been cleaned. Please review.

@HPCCSmoketest
Copy link
Contributor

Automated Smoketest
Sha: 807f0a9
Build: success
Install hpccsystems-platform-community_6.1.0-trunk0.el6.x86_64.rpm
HPCC Start: OK
Unittest result: total:83 passed:83 failed:0

HPCC Stop: OK
HPCC Uninstall: OK

Copy link
Member

@afishbeck afishbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to remind Gordon that it needs to be integrated into the UI.

@wangkx
Copy link
Member Author

wangkx commented Sep 19, 2016

@GordonSmith or @miguelvazq you may need to add an option to download WU Result csv to ECLWatch UI: https://track.hpccsystems.com/browse/HPCC-16325.

@richardkchapman this PR is ready to be merged.

@richardkchapman richardkchapman merged commit 0abaf77 into hpcc-systems:master Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants