You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Ashutosh Chauhan <ha...@apache.org> on 2014/08/22 17:16:57 UTC

Review Request 24981: Handle unary op.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24981/
-----------------------------------------------------------

Review request for hive and John Pullokkaran.


Bugs: HIVE-7852
    https://issues.apache.org/jira/browse/HIVE-7852


Repository: hive


Description
-------

Handle unary op.


Diffs
-----

  branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java 1619831 
  branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q 1619831 
  branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out 1619831 

Diff: https://reviews.apache.org/r/24981/diff/


Testing
-------

Added new test.


Thanks,

Ashutosh Chauhan


Re: Review Request 24981: Handle unary op.

Posted by John Pullokkaran <jp...@hortonworks.com>.

> On Aug. 22, 2014, 5:36 p.m., John Pullokkaran wrote:
> > branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java, line 125
> > <https://reviews.apache.org/r/24981/diff/1/?file=667267#file667267line125>
> >
> >     It seems that only change needed is to add unuary plus, minus to builder table.
> >     registerFunction("++", SqlStdOperatorTable.UNARY_PLUS, hToken(HiveParser.PLUS, "PLUS"));
> >     registerFunction("--", SqlStdOperatorTable.UNARY_MINUS, hToken(HiveParser.PLUS, "MINUS"));
> 
> Ashutosh Chauhan wrote:
>     I am not sure how this can work, since in both map and reverse lookup map, + is overloaded for both unary & binary (+) operators. 
>     What you suggested can work only if we change annotation description of GenericUDFOpNegative in Hive & UnaryMinus in Optiq from - to --.

OK yes, i see the issue.


- John


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24981/#review51296
-----------------------------------------------------------


On Aug. 22, 2014, 3:16 p.m., Ashutosh Chauhan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24981/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2014, 3:16 p.m.)
> 
> 
> Review request for hive and John Pullokkaran.
> 
> 
> Bugs: HIVE-7852
>     https://issues.apache.org/jira/browse/HIVE-7852
> 
> 
> Repository: hive
> 
> 
> Description
> -------
> 
> Handle unary op.
> 
> 
> Diffs
> -----
> 
>   branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java 1619831 
>   branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q 1619831 
>   branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out 1619831 
> 
> Diff: https://reviews.apache.org/r/24981/diff/
> 
> 
> Testing
> -------
> 
> Added new test.
> 
> 
> Thanks,
> 
> Ashutosh Chauhan
> 
>


Re: Review Request 24981: Handle unary op.

Posted by Ashutosh Chauhan <ha...@apache.org>.

> On Aug. 22, 2014, 5:36 p.m., John Pullokkaran wrote:
> > branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java, line 125
> > <https://reviews.apache.org/r/24981/diff/1/?file=667267#file667267line125>
> >
> >     It seems that only change needed is to add unuary plus, minus to builder table.
> >     registerFunction("++", SqlStdOperatorTable.UNARY_PLUS, hToken(HiveParser.PLUS, "PLUS"));
> >     registerFunction("--", SqlStdOperatorTable.UNARY_MINUS, hToken(HiveParser.PLUS, "MINUS"));

I am not sure how this can work, since in both map and reverse lookup map, + is overloaded for both unary & binary (+) operators. 
What you suggested can work only if we change annotation description of GenericUDFOpNegative in Hive & UnaryMinus in Optiq from - to --.


- Ashutosh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24981/#review51296
-----------------------------------------------------------


On Aug. 22, 2014, 3:16 p.m., Ashutosh Chauhan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24981/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2014, 3:16 p.m.)
> 
> 
> Review request for hive and John Pullokkaran.
> 
> 
> Bugs: HIVE-7852
>     https://issues.apache.org/jira/browse/HIVE-7852
> 
> 
> Repository: hive
> 
> 
> Description
> -------
> 
> Handle unary op.
> 
> 
> Diffs
> -----
> 
>   branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java 1619831 
>   branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q 1619831 
>   branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out 1619831 
> 
> Diff: https://reviews.apache.org/r/24981/diff/
> 
> 
> Testing
> -------
> 
> Added new test.
> 
> 
> Thanks,
> 
> Ashutosh Chauhan
> 
>


Re: Review Request 24981: Handle unary op.

Posted by John Pullokkaran <jp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24981/#review51296
-----------------------------------------------------------



branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java
<https://reviews.apache.org/r/24981/#comment89437>

    It seems that only change needed is to add unuary plus, minus to builder table.
    registerFunction("++", SqlStdOperatorTable.UNARY_PLUS, hToken(HiveParser.PLUS, "PLUS"));
    registerFunction("--", SqlStdOperatorTable.UNARY_MINUS, hToken(HiveParser.PLUS, "MINUS"));


- John Pullokkaran


On Aug. 22, 2014, 3:16 p.m., Ashutosh Chauhan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24981/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2014, 3:16 p.m.)
> 
> 
> Review request for hive and John Pullokkaran.
> 
> 
> Bugs: HIVE-7852
>     https://issues.apache.org/jira/browse/HIVE-7852
> 
> 
> Repository: hive
> 
> 
> Description
> -------
> 
> Handle unary op.
> 
> 
> Diffs
> -----
> 
>   branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java 1619831 
>   branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q 1619831 
>   branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out 1619831 
> 
> Diff: https://reviews.apache.org/r/24981/diff/
> 
> 
> Testing
> -------
> 
> Added new test.
> 
> 
> Thanks,
> 
> Ashutosh Chauhan
> 
>


Re: Review Request 24981: Handle unary op.

Posted by John Pullokkaran <jp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24981/#review51315
-----------------------------------------------------------

Ship it!


+1

- John Pullokkaran


On Aug. 22, 2014, 3:16 p.m., Ashutosh Chauhan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24981/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2014, 3:16 p.m.)
> 
> 
> Review request for hive and John Pullokkaran.
> 
> 
> Bugs: HIVE-7852
>     https://issues.apache.org/jira/browse/HIVE-7852
> 
> 
> Repository: hive
> 
> 
> Description
> -------
> 
> Handle unary op.
> 
> 
> Diffs
> -----
> 
>   branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/SqlFunctionConverter.java 1619831 
>   branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q 1619831 
>   branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out 1619831 
> 
> Diff: https://reviews.apache.org/r/24981/diff/
> 
> 
> Testing
> -------
> 
> Added new test.
> 
> 
> Thanks,
> 
> Ashutosh Chauhan
> 
>