You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Shehzaad Nakhoda (JIRA)" <ji...@apache.org> on 2017/06/10 07:43:18 UTC

[jira] [Updated] (PHOENIX-3934) VARBINARY type doesn't have a useful representation in sqlline.py

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

Shehzaad Nakhoda updated PHOENIX-3934:
--------------------------------------
    Description: 
When interacting with a commonly-used command line client like sqlline.py a VARBINARY type is not represented in a useful way in query results. The value seems to be a representation of the Java hashcode for the byte array, which changes with every query.

The following transcript will make this obvious. Note the value of MYBYTES is hard to make use of and moreover it changes with every query. I would like to see some stable representation of the byte array itself.

0: jdbc:phoenix:localhost:2181:/hbase> create table my_table (name VARCHAR PRIMARY KEY, mybytes VARBINARY);
No rows affected (2.33 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> upsert into my_table(name, mybytes) values('hello', '12312');
1 row affected (0.004 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> select * from my_table;
+--------+-------------+
|  NAME  |   MYBYTES   |
+--------+-------------+
| hello  | [B@650eab8  |
+--------+-------------+
1 row selected (0.017 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> select * from my_table;
+--------+--------------+
|  NAME  |   MYBYTES    |
+--------+--------------+
| hello  | [B@53f48368  |
+--------+--------------+
1 row selected (0.015 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> select * from my_table;
+--------+--------------+
|  NAME  |   MYBYTES    |
+--------+--------------+
| hello  | [B@71b3bc45  |
+--------+--------------+
1 row selected (0.015 seconds)




> VARBINARY type doesn't have a useful representation in sqlline.py
> -----------------------------------------------------------------
>
>                 Key: PHOENIX-3934
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3934
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Shehzaad Nakhoda
>
> When interacting with a commonly-used command line client like sqlline.py a VARBINARY type is not represented in a useful way in query results. The value seems to be a representation of the Java hashcode for the byte array, which changes with every query.
> The following transcript will make this obvious. Note the value of MYBYTES is hard to make use of and moreover it changes with every query. I would like to see some stable representation of the byte array itself.
> 0: jdbc:phoenix:localhost:2181:/hbase> create table my_table (name VARCHAR PRIMARY KEY, mybytes VARBINARY);
> No rows affected (2.33 seconds)
> 0: jdbc:phoenix:localhost:2181:/hbase> upsert into my_table(name, mybytes) values('hello', '12312');
> 1 row affected (0.004 seconds)
> 0: jdbc:phoenix:localhost:2181:/hbase> select * from my_table;
> +--------+-------------+
> |  NAME  |   MYBYTES   |
> +--------+-------------+
> | hello  | [B@650eab8  |
> +--------+-------------+
> 1 row selected (0.017 seconds)
> 0: jdbc:phoenix:localhost:2181:/hbase> select * from my_table;
> +--------+--------------+
> |  NAME  |   MYBYTES    |
> +--------+--------------+
> | hello  | [B@53f48368  |
> +--------+--------------+
> 1 row selected (0.015 seconds)
> 0: jdbc:phoenix:localhost:2181:/hbase> select * from my_table;
> +--------+--------------+
> |  NAME  |   MYBYTES    |
> +--------+--------------+
> | hello  | [B@71b3bc45  |
> +--------+--------------+
> 1 row selected (0.015 seconds)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)