You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Sergey Belousov <se...@gmail.com> on 2015/03/18 15:23:25 UTC
Phoenix ARRAY[] datatype representation through JDBC
Hi
When I query VIEW with ARRAY[] datatype (specifically UNSIGNED_INT ARRAY[]
in my case) in sqlline it shows me this long string as value of the array
column..
org.apache.phoenix.schema.types.PhoenixArray$PrimitiveIntPhoenixArray@d338d
So am wondering if that expected behaviour and how this aligned with JDBC
(ODBC) supported types?
It looks like JDBC supports ARRAY datatype according to this
http://db.apache.org/ojb/docu/guides/jdbc-types.html
Should we actually do something so instead of
org.apache.phoenix.schema.types.PhoenixArray$PrimitiveIntPhoenixArray@d338d
we would see something like [1,2,3,555,666] etc?
Thank you
SB.
Re: Phoenix ARRAY[] datatype representation through JDBC
Posted by Sergey Belousov <se...@gmail.com>.
thank you, Gabriel
log as improvement
https://issues.apache.org/jira/browse/PHOENIX-1759
On Thu, Mar 19, 2015 at 3:09 PM, Gabriel Reid <ga...@gmail.com>
wrote:
> Hi Sergey,
>
> You get a string like this because sqlline calls ResultSet.getString() on
> the array column. I see this as more of an issue in sqlline than in
> Phoenix, as the value that is returned is a valid JDBC array.
>
> That being said, it would be as simple as adding a decent toString
> implementation in PhoenixArray (or each of its subclasses) to get the kind
> of behavior you're talking about.
>
> Could you log a JIRA ticket for this?
>
> - Gabriel
>
>
> On Wed, Mar 18, 2015 at 3:23 PM Sergey Belousov <sergey.belousov@gmail.com
> >
> wrote:
>
> > Hi
> >
> > When I query VIEW with ARRAY[] datatype (specifically UNSIGNED_INT
> ARRAY[]
> > in my case) in sqlline it shows me this long string as value of the array
> > column..
> >
> > org.apache.phoenix.schema.types.PhoenixArray$
> > PrimitiveIntPhoenixArray@d338d
> >
> > So am wondering if that expected behaviour and how this aligned with JDBC
> > (ODBC) supported types?
> >
> > It looks like JDBC supports ARRAY datatype according to this
> > http://db.apache.org/ojb/docu/guides/jdbc-types.html
> >
> > Should we actually do something so instead of
> > org.apache.phoenix.schema.types.PhoenixArray$
> > PrimitiveIntPhoenixArray@d338d
> > we would see something like [1,2,3,555,666] etc?
> >
> > Thank you
> > SB.
> >
>
Re: Phoenix ARRAY[] datatype representation through JDBC
Posted by Gabriel Reid <ga...@gmail.com>.
Hi Sergey,
You get a string like this because sqlline calls ResultSet.getString() on
the array column. I see this as more of an issue in sqlline than in
Phoenix, as the value that is returned is a valid JDBC array.
That being said, it would be as simple as adding a decent toString
implementation in PhoenixArray (or each of its subclasses) to get the kind
of behavior you're talking about.
Could you log a JIRA ticket for this?
- Gabriel
On Wed, Mar 18, 2015 at 3:23 PM Sergey Belousov <se...@gmail.com>
wrote:
> Hi
>
> When I query VIEW with ARRAY[] datatype (specifically UNSIGNED_INT ARRAY[]
> in my case) in sqlline it shows me this long string as value of the array
> column..
>
> org.apache.phoenix.schema.types.PhoenixArray$
> PrimitiveIntPhoenixArray@d338d
>
> So am wondering if that expected behaviour and how this aligned with JDBC
> (ODBC) supported types?
>
> It looks like JDBC supports ARRAY datatype according to this
> http://db.apache.org/ojb/docu/guides/jdbc-types.html
>
> Should we actually do something so instead of
> org.apache.phoenix.schema.types.PhoenixArray$
> PrimitiveIntPhoenixArray@d338d
> we would see something like [1,2,3,555,666] etc?
>
> Thank you
> SB.
>