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

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

Ryan Blue created SPARK-22345:
---------------------------------

             Summary: 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:

```
Object smj_obj1 = ((Expression) references[2]).eval(smj_rightRow1);
```

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