You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Ashish Thusoo (JIRA)" <ji...@apache.org> on 2009/04/28 17:51:30 UTC

[jira] Created: (HIVE-454) Support escaping of ; in strings in cli

Support escaping of ; in strings in cli
---------------------------------------

                 Key: HIVE-454
                 URL: https://issues.apache.org/jira/browse/HIVE-454
             Project: Hadoop Hive
          Issue Type: Bug
          Components: Clients
    Affects Versions: 0.3.0
            Reporter: Ashish Thusoo
            Assignee: Ashish Thusoo


If ; appears in string literals in a query the hive cli is not able to escape them properly.


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


[jira] Commented: (HIVE-454) Support escaping of ; in strings in cli

Posted by "Edward Capriolo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733976#action_12733976 ] 

Edward Capriolo commented on HIVE-454:
--------------------------------------

That is a good point. However it seems that the CLIDriver will be have to change regardless. Since the CLIDriver is specifically splitting on ';' a statement like "set a=5; set b=8" gets passed as two separate qp.run()'s.

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Ashish Thusoo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Commented: (HIVE-454) Support escaping of ; in strings in cli

Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740266#action_12740266 ] 

Namit Jain commented on HIVE-454:
---------------------------------

The changes look OK to me - 

Raghu, for this to work with Hive.g - the entire string would have to be passed to qp. So, essentially qp will take in a bunch of queries and then parse them instead of getting one query at a time.
This requires substantial change and should not block https://issues.apache.org/jira/browse/HIVE-645


> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Edward Capriolo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Updated: (HIVE-454) Support escaping of ; in strings in cli

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

Ashish Thusoo updated HIVE-454:
-------------------------------

    Assignee: Edward Capriolo  (was: Ashish Thusoo)

Ownership = Patch submitter...

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Edward Capriolo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Commented: (HIVE-454) Support escaping of ; in strings in cli

Posted by "Raghotham Murthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733858#action_12733858 ] 

Raghotham Murthy commented on HIVE-454:
---------------------------------------

It seems cleaner to modify hive.g instead of adding more parsing/manipulation of query strings in CliDriver.

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Ashish Thusoo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Updated: (HIVE-454) Support escaping of ; in strings in cli

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

Namit Jain updated HIVE-454:
----------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

Committed. Thanks Edward

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Edward Capriolo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Commented: (HIVE-454) Support escaping of ; in strings in cli

Posted by "Edward Capriolo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740073#action_12740073 ] 

Edward Capriolo commented on HIVE-454:
--------------------------------------

Digging into this some more it seems that the query processor and cli driver would have to work together in a different way.

As of now the CLIDriver is physically splitting on ';'  it can not tell the difference between ';' and '/;'. My patch adds some logic to detect '/;' and unescape it before passing to qp.run(String).

Right now we can argue that the CliDriver has an implicit 'autocommit=true'. We can make this an explicit variable. with autocommit='false'  the query processor would hold a StringBuffer or a queue of query strings. 'commit ' ; would cause QP to run each query in its queue.

This is a non-trivial change. If we add this feature we can set autocommit=true so the default behavior does not change. For no though my patch has a fairly way to deal with this problem.


> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Ashish Thusoo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Updated: (HIVE-454) Support escaping of ; in strings in cli

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

Carl Steinbach updated HIVE-454:
--------------------------------

    Fix Version/s: 0.4.0

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Edward Capriolo
>             Fix For: 0.4.0
>
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Commented: (HIVE-454) Support escaping of ; in strings in cli

Posted by "Edward Capriolo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731643#action_12731643 ] 

Edward Capriolo commented on HIVE-454:
--------------------------------------

Ashish,
I actually am working on a UDF where this became an issue. My .q file looks like this.

{noformat}
SELECT dboutput(
'jdbc:derby:../build/test_dboutput_db;create=true','',''
,'CREATE TABLE app_info ( kkey VARCHAR(255) NOT NULL, vvalue VARCHAR(255) NOT NULL )') , dboutput('jdbc:derby:../build/test_dboutput_db','','',
'INSERT INTO app_info (kkey,vvalue) VALUES (?,?)','1','a')
limit 1;
{noformat}

the ';create=true' section is failing. My nickname is 'Corner Case' :)

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Ashish Thusoo
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Updated: (HIVE-454) Support escaping of ; in strings in cli

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

Edward Capriolo updated HIVE-454:
---------------------------------

    Attachment: hive-454.patch

Updated CLIDriver and added test case

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Ashish Thusoo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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


[jira] Commented: (HIVE-454) Support escaping of ; in strings in cli

Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740598#action_12740598 ] 

Namit Jain commented on HIVE-454:
---------------------------------

@Raghu, are you OK with this change - it is OK from my end

> Support escaping of ; in strings in cli
> ---------------------------------------
>
>                 Key: HIVE-454
>                 URL: https://issues.apache.org/jira/browse/HIVE-454
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: 0.3.0
>            Reporter: Ashish Thusoo
>            Assignee: Edward Capriolo
>         Attachments: hive-454.patch
>
>
> If ; appears in string literals in a query the hive cli is not able to escape them properly.

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