You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by He Yongqiang <he...@software.ict.ac.cn> on 2009/04/27 12:50:19 UTC

The query can not be explained.

Hi, I used one query in my testcase, which was:
 FROM (FROM src MAP (src.key,src.value) USING 'python
../data/scripts/dumpdata_script.py' AS (key,value) WHERE src.key = 10) subq
INSERT OVERWRITE TABLE columnTable_Bigdata SELECT subq.key, subq.value;

But now the statement can not be executed after I update the code to truck.
I can only modify it to the below now, which can be successfully executed.
FROM (FROM src MAP (src.key) USING 'python
../data/scripts/dumpdata_script.py' AS (key) WHERE src.key = 10) subq INSERT
OVERWRITE TABLE columnTable_Bigdata SELECT subq.key, subq.key;

But I think it may be better to use key,value pair as input for MAP.

Re: The query can not be explained.

Posted by Zheng Shao <zs...@gmail.com>.
Hi Yongqiang,

We were allowing optional brackets after the map statement till recently,
when we have to remove that support in order to make sure the grammar can be
LL(k) non-backtracking.

Please remove the brackets after the MAP:
FROM src MAP src.key, src.value

This also applies to REDUCE (consider MAP and REDUCE as similar grammar
constructs like SELECT, where we don't need a bracket for all its
parameters).
Semantically there is no change.

Please note that the brackets in "SELECT TRANSFORM(xxx, yyy)" is required
(consider TRANSFORM to something similar like a UDF).

Zheng

On Mon, Apr 27, 2009 at 3:50 AM, He Yongqiang <
heyongqiang@software.ict.ac.cn> wrote:

>  Hi, I used one query in my testcase, which was:
>  FROM (FROM src MAP (src.key,src.value) USING 'python
> ../data/scripts/dumpdata_script.py' AS (key,value) WHERE src.key = 10) subq
> INSERT OVERWRITE TABLE columnTable_Bigdata SELECT subq.key, subq.value;
>
> But now the statement can not be executed after I update the code to truck.
> I can only modify it to the below now, which can be successfully executed.
> FROM (FROM src MAP (src.key) USING 'python
> ../data/scripts/dumpdata_script.py' AS (key) WHERE src.key = 10) subq INSERT
> OVERWRITE TABLE columnTable_Bigdata SELECT subq.key, subq.key;
>
> But I think it may be better to use key,value pair as input for MAP.
>



-- 
Yours,
Zheng