incubator-drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeraja Rentachintala <nrentachint...@maprtech.com>
Subject Re: error in flatten and join
Date Sat, 15 Nov 2014 06:23:05 GMT
Hi
Can you try creating a view on the hbase.act table to do the join.
Yon can find a view creation example in the tutorial
<https://cwiki.apache.org/confluence/display/DRILL/Analyzing+Yelp+JSON+Data+with+Apache+Drill>
(please search for create or replace view syntax)


-Neeraja


On Fri, Nov 14, 2014 at 10:16 PM, MohammadReza Mofateh <mofateh72@gmail.com>
wrote:

> No body? :)
>
> On Thu, Nov 13, 2014 at 8:44 PM, MohammadReza Mofateh <mofateh72@gmail.com
> >
> wrote:
>
> > Hi,
> > Excuse me ,I write it bad:
> >
> >
> **********************************************************************************
> > Main query:
> >
> > select * from hbase.act ,
> > (select cast(b as varchar(5))as r ,flatten(d) as f from (select row_key
> as
> > b, convert_from(mat.i.n,'json') as d from hbase.mat)) as x
> >  where  act.row_key =x.f
> >
> >
> >
> **********************************************************************************
> > In last e-mail what I mean that if I run sub query ,sub query works well
> > Sub query(It used as x in main query):
> >
> > select cast(b as varchar(5))as r ,flatten(d) as f from (select row_key as
> > b, convert_from(mat.i.n,'json') as d from hbase.mat)
> >
> > It returns me(Notice to additional details):
> > 100 |10
> > 100|1000
> > 101|1200
> > 101|20
> >
> >
> >
> >
> **********************************************************************************
> > Main query doesn't return any answer,It returns:
> >
> > Error in expression at index 0.  Error: Missing function implementation:
> > [hash(MAP-REQUIRED)].  Full expression: null..
> >
> >
> ******************************************************************************************************************
> >
> > Additional details:
> > ______________________________________________________
> > table mat:
> > row_key  |   i:n
> > 100         |  ["10","1000"]
> > 101         |  ["20","1200"]
> > ______________________________________________________
> > table act:
> > row_key  |    i:y
> > 10           |   apple
> > 20           |   orange
> > 1000        |  banana
> > 1200        |  peach
> > 1400        |  onion
> > ______________________________________________________
> >
> >
> > On Thu, Nov 13, 2014 at 7:59 PM, Ted Dunning <ted.dunning@gmail.com>
> > wrote:
> >
> >> I am having a hard time understanding your question.
> >>
> >> Are you saying that the first query gives the correct answer but giving
> >> the
> >> second query which is a sub-query in the first one gives an unexpected
> >> error?
> >>
> >> The first query that it appears that you have used is:
> >>
> >> select * from hbase.act, (
> >>     select cast(b as varchar(5)) as r,
> >>                flatten(d) as f
> >>         from (
> >>              select row_key as b, convert_from(mat.i.n,'json') as d
> >>              from hbase.mat
> >>           )
> >>      ) as x
> >> where  act.row_key =x.f
> >>
> >> And the second seems to be this:
> >>
> >> (
> >>     select cast(b as varchar(5)) as r,
> >>                flatten(d) as f
> >>     from (
> >>          select row_key as b, convert_from(mat.i.n,'json') as d
> >>          from hbase.mat
> >>     )
> >> )
> >>
> >> As far as I can tell, this is identical to the sub-query in the first
> one
> >> except that you have left parentheses around the sub-query.
> >>
> >> Is that a correct story of what you did?
> >>
> >> If so, what happens if you remove the parens?  I don't think it is legal
> >> SQL syntax to put parentheses around a query except when it is a
> >> sub-query.
> >>
> >>
> >>
> >> On Thu, Nov 13, 2014 at 6:08 AM, MohammadReza Mofateh <
> >> mofateh72@gmail.com>
> >> wrote:
> >>
> >> > Hi
> >> > I run this query:
> >> >
> >> > select * from hbase.act , (select cast(b as varchar(5))as r
> ,flatten(d)
> >> as
> >> > f from (select row_key as b, convert_from(mat.i.n,'json') as d from
> >> > hbase.mat)) as x
> >> >            where  act.row_key =x.f
> >> >
> >> > x=It return me a true answer:
> >> > table mat:
> >> > row_key  |i:n
> >> > 100         |["10","1000"]
> >> > 101         |["20","1200"]
> >> > (select cast(b as varchar(5))as r ,flatten(d) as f from (select
> row_key
> >> as
> >> > b, convert_from(mat.i.n,'json') as d from hbase.mat))
> >> >  returns me:
> >> > 100 |10
> >> > 100|1000
> >> > 101|1200
> >> > 101|20
> >> >
> >> > table act:
> >> > row_key  |i:y
> >> > 10|apple
> >> > 20|orange
> >> > 1000|banana
> >> > 1200|pich
> >> > 1400|onion
> >> >  As query it should return me:
> >> > act.row
> >> > 10
> >> > 20
> >> > 1000
> >> > 1200
> >> > 1400
> >> >
> >> > But i receive this error:
> >> >
> >> > Error in expression at index 0.  Error: Missing function
> implementation:
> >> > [hash(MAP-REQUIRED)].  Full expression: null..
> >> >
> >>
> >
> >
>

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