You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 04:12:40 UTC

[jira] [Resolved] (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:all-tabpanel ]

Hyukjin Kwon resolved SPARK-22345.
----------------------------------
    Resolution: Incomplete

> 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
>            Priority: Major
>              Labels: bulk-closed
>
> 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
(v7.6.3#76005)

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