You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2011/09/10 00:14:08 UTC

[jira] [Created] (HBASE-4361) Certain filter expressions fail in the shell

Certain filter expressions fail in the shell
--------------------------------------------

                 Key: HBASE-4361
                 URL: https://issues.apache.org/jira/browse/HBASE-4361
             Project: HBase
          Issue Type: Bug
          Components: filters, shell
    Affects Versions: 0.92.0
            Reporter: Todd Lipcon
            Priority: Critical
             Fix For: 0.92.0


Running the following in the shell hangs and then fails:
{noformat}
scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
{noformat}
The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Ted Yu (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Yu updated HBASE-4361:
--------------------------

    Fix Version/s:     (was: 0.92.0)
                   0.94.0

Moving the remaining work to 0.94
                
> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.94.0
>
>         Attachments: Filter Language.docx, small-improvements.txt
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Anirudh Todi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anirudh Todi updated HBASE-4361:
--------------------------------

    Attachment: Filter Language.docx

Updated the Filter Language document to include the error Todd caught. 

Also updated some of the examples.

However, I didn't notice any other error. 

> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>         Attachments: Filter Language.docx, small-improvements.txt
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101604#comment-13101604 ] 

Todd Lipcon commented on HBASE-4361:
------------------------------------

After hacking HBase to show a full stack trace:
{noformat}
org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClassorg.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass
        at Hbase::Table.scan(/home/todd/git/hbase/bin/../bin/../src/main/ruby/hbase/table.rb:255)
        at Shell::Commands::Scan.command(/home/todd/git/hbase/bin/../bin/../src/main/ruby/shell/commands/scan.rb:61)
        at Shell::Commands::Scan.command_safe(/home/todd/git/hbase/bin/../bin/../src/main/ruby/shell/commands.rb:31)
        at Shell::Commands::Command.translate_hbase_exceptions(/home/todd/git/hbase/bin/../bin/../src/main/ruby/shell/commands.rb:70)
        at Shell::Commands::Command.command_safe(/home/todd/git/hbase/bin/../bin/../src/main/ruby/shell/commands.rb:31)
        at Shell::Shell.command(/home/todd/git/hbase/bin/../bin/../src/main/ruby/shell.rb:106)
{noformat}

> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102840#comment-13102840 ] 

Todd Lipcon commented on HBASE-4361:
------------------------------------

bq.  I don't see how I would parse the filterString if the entire filterString is enclosed in double quotes and some of the arguments are enclosed in double quotes too?

Yep, that was my mistake :) But the shell didn't do a good job of showing me my error. Dynamic typing FTL :) My patch here at least changes the shell to say: "Invalid filter: false" instead of the strange exception I got before.

bq. Better error messages? - I can try and improve this. Are there any specific points I can address to improve what is already there

In general, all of the exceptions thrown should tell you which text caused them to throw. For example, "Invalid quoted string" is useless, but "Invalid quoted string: foo" is useful. "Mismatched parenthesis" should include the offset in the string at which it was found. "Incorrect Filter String" if the stack is non-empty at the end of parseFilterString should probably say something like "Incorrect filter string: unmatched LPAREN at offset <n>". Pretty much all of the places where IllegalArgumentException are thrown in ParseFilter could be improved to have (a) the offset at which the error occurred, and (b) details about what was incorrect.


All of the above aside, it's a nice feature once you get it to work :) Thanks for the hard work implementing it.

> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>         Attachments: Filter Language.docx, small-improvements.txt
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HBASE-4361:
-------------------------------

    Attachment: small-improvements.txt

here are a few improvements. Still need to fix the docs, etc, to be correct. Ideally IMO the filter parsing would be done by javacc or antlr so we'd have a real grammar.

> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>         Attachments: small-improvements.txt
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101618#comment-13101618 ] 

Todd Lipcon commented on HBASE-4361:
------------------------------------

For reference, the correct way to specify this is:
scan 't1', { FILTER => "SingleColumnValueFilter('f1', 'col_a', >, 'binary:1')" }

But I had to read the code for 30 minutes to figure it out. We need lots of docs updates on the filter language.


> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Anirudh Todi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102107#comment-13102107 ] 

Anirudh Todi commented on HBASE-4361:
-------------------------------------

Thanks Stack for pinging me about the Filter Language!

1. Todd, I think your test failed because the way I wrote my code, the arguments needed to be enclosed in single quotes. I know it is in the documentation I sent out, however, it may not have been highlighted. I don't see how I would parse the filterString if the entire filterString is enclosed in double quotes and some of the arguments are enclosed in double quotes too?

2. Regarding the incorrect order of arguments specified in the documentation for SingleColumnValueFilter, I apologize about that - the filter language went through several iterations and I may have overlooked updating the documentation in one place. I can take a look at it over the weekend and check the documentation again

3. Better error messages? - I can try and improve this. Are there any specific points I can address to improve what is already there?

4. Writing the filter parsing using antlr or javacc, I doubt I will have time to do that during the school semester. It's something I could potentially look into during the winter break. However, I leave this to your discretion.

Hope the Filter Language is benefiting the community!

> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>         Attachments: small-improvements.txt
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Lars Hofhansl (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated HBASE-4361:
---------------------------------

    Fix Version/s:     (was: 0.94.0)
                   0.96.0

Shuffling it on to 0.96.
                
> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.96.0
>
>         Attachments: Filter Language.docx, small-improvements.txt
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4361) Certain filter expressions fail in the shell

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101613#comment-13101613 ] 

Todd Lipcon commented on HBASE-4361:
------------------------------------

Several problems here:
1) I was using double-quotes twice, so it was passing "true" as the filter value. JRuby and its lovely lack of type checking then passed that through to the point where it tried to write true to the wire as a Writable, and failed.
2) The documentation for SingleColumnValueFilter has the incorrect order of arguments.
3) The errors given back by the filter parsing code are inscrutable.

> Certain filter expressions fail in the shell
> --------------------------------------------
>
>                 Key: HBASE-4361
>                 URL: https://issues.apache.org/jira/browse/HBASE-4361
>             Project: HBase
>          Issue Type: Bug
>          Components: filters, shell
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.92.0
>
>
> Running the following in the shell hangs and then fails:
> {noformat}
> scan 't1', { FILTER => "SingleColumnValueFilter(">", '1', 'f1', 'col_a')" }
> {noformat}
> The error seems to be: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `write' for true:TrueClass

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira