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

Michael Smith updated IMPALA-12517:
-----------------------------------
    Description: 
With a table containing binary data such as
{code}
CREATE TABLE complex_datatype (A INT, b BINARY);
INSERT INTO complex_datatype VALUES (1, CAST("a" as BINARY)), (2, CAST("8" as 
BINARY)), (3, CAST(NULL as BINARY));
{code}
querying it with Python 3 mangles the output by prefixing it with 'b' and 
quoting it
{code}
$ IMPALA_PYTHON_EXECUTABLE=python3 impala-shell.sh -q 'select * from 
complex_datatype'
...
+---+------+
| a | b    |
+---+------+
| 1 | b'a' |
| 2 | b'8' |
| 3 | NULL |
+---+------+
Fetched 3 row(s) in 0.11s
{code}

This should look like
{code}
+---+------+
| a | b    |
+---+------+
| 1 | a    |
| 2 | 8    |
| 3 | NULL |
+---+------+
{code}

Behaves the same when outputting to a file as well, with and without {{-B}}.

The beeswax protocol works fine, so this is specific to the hs2 client.

  was:
With a table containing binary data such as
{code}
CREATE TABLE complex_datatype (A INT, b BINARY);
INSERT INTO complex_datatype VALUES (1, CAST("a" as BINARY)), (2, CAST("8" as 
BINARY)), (3, CAST(NULL as BINARY));
{code}
querying it with Python 3 mangles the output by prefixing it with 'b' and 
quoting it
{code}
$ IMPALA_PYTHON_EXECUTABLE=python3 impala-shell.sh -q 'select * from 
complex_datatype'
...
+---+------+
| a | b    |
+---+------+
| 1 | b'a' |
| 2 | b'8' |
| 3 | NULL |
+---+------+
Fetched 3 row(s) in 0.11s
{code}

This should look like
{code}
+---+------+
| a | b    |
+---+------+
| 1 | a    |
| 2 | 8    |
| 3 | NULL |
+---+------+
{code}

Behaves the same when outputting to a file as well, with and without {{-B}}.


> impala-shell with Python 3 mangles binary output
> ------------------------------------------------
>
>                 Key: IMPALA-12517
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12517
>             Project: IMPALA
>          Issue Type: Bug
>    Affects Versions: Impala 4.3.0
>            Reporter: Michael Smith
>            Assignee: Michael Smith
>            Priority: Major
>
> With a table containing binary data such as
> {code}
> CREATE TABLE complex_datatype (A INT, b BINARY);
> INSERT INTO complex_datatype VALUES (1, CAST("a" as BINARY)), (2, CAST("8" as 
> BINARY)), (3, CAST(NULL as BINARY));
> {code}
> querying it with Python 3 mangles the output by prefixing it with 'b' and 
> quoting it
> {code}
> $ IMPALA_PYTHON_EXECUTABLE=python3 impala-shell.sh -q 'select * from 
> complex_datatype'
> ...
> +---+------+
> | a | b    |
> +---+------+
> | 1 | b'a' |
> | 2 | b'8' |
> | 3 | NULL |
> +---+------+
> Fetched 3 row(s) in 0.11s
> {code}
> This should look like
> {code}
> +---+------+
> | a | b    |
> +---+------+
> | 1 | a    |
> | 2 | 8    |
> | 3 | NULL |
> +---+------+
> {code}
> Behaves the same when outputting to a file as well, with and without {{-B}}.
> The beeswax protocol works fine, so this is specific to the hs2 client.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to