You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2017/10/24 21:57:00 UTC

[jira] [Commented] (SPARK-22345) Sort-merge join generates incorrect code for CodegenFallback filter conditions

    [ https://issues.apache.org/jira/browse/SPARK-22345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16217772#comment-16217772 ] 

Apache Spark commented on SPARK-22345:
--------------------------------------

User 'rdblue' has created a pull request for this issue:
https://github.com/apache/spark/pull/19568

> Sort-merge join generates incorrect code for CodegenFallback filter conditions
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-22345
>                 URL: https://issues.apache.org/jira/browse/SPARK-22345
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.1
>            Reporter: Ryan Blue
>
> I have a job that is producing incorrect results from a sort-merge join with a filter on an expression with a Hive UDF. The results are correct when codgen is turned off.
> I tracked the problem to the evaluation of the Hive UDF, here:
> {code:lang=java}
> Object smj_obj1 = ((Expression) references[2]).eval(smj_rightRow1);
> {code}
> The UDF references columns from both left and right, so this was clearly generated incorrectly. I think it is that the expression used for Hive UDFs is a CodegenFallback, which uses eval instead of local variables. The non-codegen implementations pass a joined row into eval and creating a joined row in codegen fixes the problem. I'll post a PR in a minute.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org