hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carl Steinbach (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HIVE-1431) Hive CLI can't handle query files that begin with comments
Date Mon, 10 Jan 2011 04:14:47 GMT

     [ https://issues.apache.org/jira/browse/HIVE-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Carl Steinbach updated HIVE-1431:
---------------------------------

    Fix Version/s:     (was: 0.7.0)
           Status: Open  (was: Patch Available)

@iryoung: I think it's going to be really hard to make a regex work for this purpose.

{code:java}
  private String removeComment(String line) {
      return line.replaceFirst("--.+$","").trim();
  }
{code}

This regex is going to mangle SQL such as the following:

{code:sql}
SELECT a, '--' FROM tab;
{code}



> Hive CLI can't handle query files that begin with comments
> ----------------------------------------------------------
>
>                 Key: HIVE-1431
>                 URL: https://issues.apache.org/jira/browse/HIVE-1431
>             Project: Hive
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 0.7.0
>            Reporter: Carl Steinbach
>         Attachments: hive-1431.patch
>
>
> {code}
> % cat test.q
> -- This is a comment, followed by a command
> set -v;
> -- 
> -- Another comment
> --
> show tables;
> -- Last comment
> (master) [ ~/Projects/hive ]
> % hive < test.q
> Hive history file=/tmp/carl/hive_job_log_carl_201006231606_1140875653.txt
> hive> -- This is a comment, followed by a command
>     > set -v;
> FAILED: Parse Error: line 2:0 cannot recognize input 'set'
> hive> -- 
>     > -- Another comment
>     > --
>     > show tables;
> OK
> rawchunks
> Time taken: 5.334 seconds
> hive> -- Last comment
>     > (master) [ ~/Projects/hive ]
> % 
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message