Github user zzeekk commented on the issue:

    https://github.com/apache/spark/pull/7379
  
    @IceMan81 Here is an abstract example of our workaround, building blocks as 
additional equi-join conditions.
    The task is to join Points (df1) on a line back to Segments of the same 
line (df2): df1.id_line=df2.id_line and df1.position>=df2.position_from and 
df1.position<df2.position_to
    By building blocks for the position, we can add a more detailed equi-join 
condition, but need to join twice and coalesce results to catch the case when 
position_from is in a different block than position. Additional note: block 
size (/10) must be adapted to expected data:
    ```
      df1.as("df1")
      .join( df2.as("df2a"), $"df1.id_line"===$"df2a.id_line" and 
floor($"df1.position"/10)===floor($"df2a.position_from"/10) 
                               and $"df1.position">=$"df2a.position_from" and 
$"df1.position"<$"df2a.position_to", "left")
      .join( df2.as("df2a"), $"df1.id_line"===$"df2a.id_line" and 
floor($"df1.position"/10)===floor($"df2a.position_to"/10) 
                               and $"df1.position">=$"df2a.position_from" and 
$"df1.position"<$"df2a.position_to", "left")
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to