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

Tim Armstrong resolved IMPALA-1184.
-----------------------------------
    Resolution: Duplicate

> impala-shell converts newlines to spaces in multi-line literals
> ---------------------------------------------------------------
>
>                 Key: IMPALA-1184
>                 URL: https://issues.apache.org/jira/browse/IMPALA-1184
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: Impala 2.0
>         Environment: I'm using the latest 2.0 build.
>            Reporter: John Russell
>            Priority: Minor
>              Labels: impala-shell
>
> Now that impala-shell doesn't get confused by a line with an unbalanced 
> single quote, I tried inserting a multi-line string literal. Looks like 
> impala-shell normalizes all newlines (even inside string literals) to spaces 
> before sending to the back end:
> [localhost:21000] > create table string_t (s string);
> [localhost:21000] > insert into string_t values ('hello
>                   > world');
> [localhost:21000] > select * from string_t;
> +-------------+
> | s           |
> +-------------+
> | hello world |
> +-------------+
> I'm expecting behavior similar to MySQL, where even if the newline causes the 
> query output to be formatted weirdly, it still preserves the newline:
> mysql> create table string_t (s varchar(64));
> Query OK, 0 rows affected (0.06 sec)
> mysql> insert into string_t values ('hello
>     '> world');
> Query OK, 1 row affected (0.00 sec)
> mysql> select * from string_t;
> +-------------+
> | s           |
> +-------------+
> | hello
> world |
> +-------------+
> 1 row in set (0.00 sec)
> When I cursor up in impala-shell, back to the INSERT...VALUES statement, the 
> line-recalling code also turns the newline back into a space:
> [localhost:21000] > insert into string_t values ('hello world');
> MySQL's readline behavior is to only show that part of the line up to the 
> newline:
> ...cursor up...
> mysql> world');
> ...cursor up...
> mysql> insert into string_t values ('hello
> They must be special-casing multi-line literals because if I split some other 
> kind of statement over multiple lines, it does join them into one line when 
> recalling the statement:
> mysql> create table
>     -> foo (x int);
> Query OK, 0 rows affected (0.04 sec)
> ...cursor up...
> mysql> create table foo (x int);



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to