drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jinfeng Ni <jinfengn...@gmail.com>
Subject Re: Multiple Column Aliasing Into A Nested JSON Data Fails
Date Fri, 10 Oct 2014 17:19:09 GMT
Please file a JIRA for this.

My guess is this is not revenant to column alias. Rather, it's revenant to
referencing the nested data using the same prefix path expression (
Reservations[0].Instances[0]) multiple times in the query.  There might be
a bug in the code in "reset" to the original status, when the same prefix
is referred for a second time.



On Fri, Oct 10, 2014 at 8:25 AM, Neeraja Rentachintala <
nrentachintala@maprtech.com> wrote:

> Seems like a bug to me.
>
> On Fri, Oct 10, 2014 at 6:42 AM, mufy <mufeed.usman@gmail.com> wrote:
>
> > The below works.
> >
> > 0: jdbc:drill:zk=n67:5181> select Reservations[0].OwnerId as ID,
> > Reservations[0].ReservationId as RID from dfs.`aws.json`;
> > +------------+------------+
> > |     ID     |    RID     |
> > +------------+------------+
> > | 898107336781 | r-48a03243 |
> > +------------+------------+
> > 1 row selected (0.217 seconds)
> >
> >
> > But when I dig a little deeper into my nested JSON to do a multiple
> column
> > aliasing it fails.
> >
> >
> > 0: jdbc:drill:zk=n67:5181> select Reservations[0].Instances[0].InstanceId
> > as ID, Reservations[0].Instances[0].PrivateDnsName as IP from
> > dfs.`aws.json`;
> > Query failed: Failure while running fragment. index: -4, length: 4
> > (expected: range(0, 16384)) [fea47ee2-f588-4fbf-bb2b-113e25c71779]
> >
> > Error: exception while executing query: Failure while trying to get next
> > result batch. (state=,code=0)
> >
> >
> > Although I'm able to reach the elements into the nested JSON
> individually.
> >
> >
> > 0: jdbc:drill:zk=n67:5181> select Reservations[0].Instances[0].InstanceId
> > as ID from dfs.`aws.json`;
> > +------------+
> > |     ID     |
> > +------------+
> > | i-85d5e28e |
> > +------------+
> > 1 row selected (0.182 seconds)
> >
> > 0: jdbc:drill:zk=n67:5181> select
> > Reservations[0].Instances[0].PrivateDnsName as IP from dfs.`aws.json`;
> > +------------+
> > |     IP     |
> > +------------+
> > | ip-10-253-11-180.us-west-2.compute.internal |
> > +------------+
> > 1 row selected (0.174 seconds)
> >
> > Is it my query or a bug?
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message