hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Min Zhou <coderp...@gmail.com>
Subject Re: about join query
Date Wed, 10 Jun 2009 07:06:13 GMT
then how about below?

SELECT
  a.subid, a.id, t.url
FROM
  tbl t JOIN aux_tbl a ON regexp_like(t.url, a.url_pattern)
WHERE
  t.dt='20090609'
  AND a.dt='20090609';

the udf regexp_like have the same function with rlike, the only difference
between them is one is a prefix operator and the other is a infix operator.

Thanks,
Min

On Wed, Jun 10, 2009 at 2:58 PM, Zheng Shao <zshao9@gmail.com> wrote:

> If this does not work, and you have a concrete idea on how to make it work,
> please open a jira and post your idea there. We can start the discussion
> from there.
>
> Zheng
>
>
> On Tue, Jun 9, 2009 at 11:54 PM, Zheng Shao <zshao9@gmail.com> wrote:
>
>> We only support EQUI-JOIN: join with equal condition.
>>
>> Is it possible to write a UDF: get_pattern(t.url) ?
>>
>> SELECT
>>   a.subid, a.id, t.url
>> FROM
>>   tbl t JOIN aux_tbl a ON get_pattern(t.url) = a.url_pattern
>> WHERE
>>   t.dt='20090609'
>>   AND a.dt='20090609';
>>
>> Zheng
>>
>>
>> On Tue, Jun 9, 2009 at 11:38 PM, Min Zhou <coderplay@gmail.com> wrote:
>>
>>> I have a query like below,
>>>
>>> SELECT
>>>   a.subid, a.id, t.url
>>> FROM
>>>   tbl t JOIN aux_tbl a ON t.url rlike a.url_pattern
>>> WHERE
>>>   t.dt='20090609'
>>>   AND a.dt='20090609';
>>>
>>> and parser reported 'FAILED: Error in semantic analysis: line 4:xx Both
>>> Left and Right Aliases Encountered in Join url_pattern'
>>>
>>> how can i correct this query?
>>>
>>> Thanks,
>>> Min
>>> --
>>> My research interests are distributed systems, parallel computing and
>>> bytecode based virtual machine.
>>>
>>> My profile:
>>> http://www.linkedin.com/in/coderplay
>>> My blog:
>>> http://coderplay.javaeye.com
>>>
>>
>>
>>
>> --
>> Yours,
>> Zheng
>>
>
>
>
> --
> Yours,
> Zheng
>



-- 
My research interests are distributed systems, parallel computing and
bytecode based virtual machine.

My profile:
http://www.linkedin.com/in/coderplay
My blog:
http://coderplay.javaeye.com

Mime
View raw message