incubator-drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: error in flatten and join
Date Thu, 13 Nov 2014 16:29:50 GMT
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