Skip to content

Issue 1129 fix grep pn option#1135

Merged
keith-turner merged 6 commits intoapache:masterfrom
DonResnik:Issue-1129-fix-grep-pn-option
May 7, 2019
Merged

Issue 1129 fix grep pn option#1135
keith-turner merged 6 commits intoapache:masterfrom
DonResnik:Issue-1129-fix-grep-pn-option

Conversation

@DonResnik
Copy link
Copy Markdown
Contributor

@DonResnik DonResnik commented Apr 28, 2019

Here are the commands I ran to test this:
root@uno> createtable test
root@uno> insert row1 colf colq value
root@uno> insert row1 colf1 colq value
root@uno> insert row2 colf colq value
root@uno> insert row2 colf1 colq value
root@uno test> scan
row1 colf:colq1 [] value
row1 colf1:colq1 [] value
row2 colf:colq1 [] value
row2 colf1:colq1 [] value
root@uno test> setshelliter -class org.apache.accumulo.core.iterators.ColumnFamilyCounter -p 100 -pn testIter
[skipped the name and name-value setting options]
root@uno test> scan -pn testIter
row1 colf: [] 1
row1 colf1: [] 1
row2 colf: [] 1
row2 colf1: [] 1
root@uno test> grep row1 -pn testIter
row1 colf: [] 1
row1 colf1: [] 1
root@uno test> egrep .row1. -pn testIter
row1 colf: [] 1
row1 colf1: [] 1

the pn (profile name) option existed for grep and egrep commands, but it did not do anything.  Fix adds iterators with given pn to the grep and egrep scanner
Copy link
Copy Markdown
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

DonResnik added 2 commits May 1, 2019 05:32
Add check for pn option in Grep and Egrep commands.  When pn is used, only grep from iterators in that profile.
@DonResnik
Copy link
Copy Markdown
Contributor Author

I rebased and squashed to update the bad commit comments. They are still in the history here, but they are not on the branch. Please let me know if I need to do anything else.

final Options opts = super.getOptions();
numThreadsOpt = new Option("nt", "num-threads", true, "number of threads to use");
negateOpt = new Option("v", "negate", false, "only include rows without search term");
profileNameOpt = new Option("pn", "profile-name", true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not completely sure, but I think the earlier call to super.getOptions(); may already add a profile option.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agreed, code updated

Make small updates to ScanCommand.java to provide for inherited pn option to work for grep and egrep commands
@keith-turner keith-turner merged commit 531d258 into apache:master May 7, 2019
@keith-turner
Copy link
Copy Markdown
Contributor

Looks good, thanks @DonResnik

@ctubbsii ctubbsii added the v2.0.0 label May 7, 2019
@ctubbsii ctubbsii added this to the 2.0.0 milestone Jul 12, 2024
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.

3 participants