GitHub user watermen opened a pull request:

    https://github.com/apache/spark/pull/14988

    [SPARK-17425][SQL] Override sameResult in HiveTableScanExec to make 
ReusedExchange work in text format table

    ## What changes were proposed in this pull request?
    The PR will override the `sameResult` in `HiveTableScanExec` to make 
`ReusedExchange` work in text format table.
    
    ## How was this patch tested?
    # SQL
    ```sql
    SELECT * FROM src t1
    JOIN src t2 ON t1.key = t2.key
    JOIN src t3 ON t1.key = t3.key;
    ```
    
    # Before
    ```
    == Physical Plan ==
    *BroadcastHashJoin [key#30], [key#34], Inner, BuildRight
    :- *BroadcastHashJoin [key#30], [key#32], Inner, BuildRight
    :  :- *Filter isnotnull(key#30)
    :  :  +- HiveTableScan [key#30, value#31], MetastoreRelation default, src
    :  +- BroadcastExchange HashedRelationBroadcastMode(List(cast(input[0, int, 
false] as bigint)))
    :     +- *Filter isnotnull(key#32)
    :        +- HiveTableScan [key#32, value#33], MetastoreRelation default, src
    +- BroadcastExchange HashedRelationBroadcastMode(List(cast(input[0, int, 
false] as bigint)))
       +- *Filter isnotnull(key#34)
          +- HiveTableScan [key#34, value#35], MetastoreRelation default, src
    ```
    
    # After
    ```
    == Physical Plan ==
    *BroadcastHashJoin [key#2], [key#6], Inner, BuildRight
    :- *BroadcastHashJoin [key#2], [key#4], Inner, BuildRight
    :  :- *Filter isnotnull(key#2)
    :  :  +- HiveTableScan [key#2, value#3], MetastoreRelation default, src
    :  +- BroadcastExchange HashedRelationBroadcastMode(List(cast(input[0, int, 
false] as bigint)))
    :     +- *Filter isnotnull(key#4)
    :        +- HiveTableScan [key#4, value#5], MetastoreRelation default, src
    +- ReusedExchange [key#6, value#7], BroadcastExchange 
HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)))
    ```
    
    cc: @davies @cloud-fan


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/watermen/spark SPARK-17425

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14988.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14988
    
----
commit 8e537a161560a6d717a40d8aae44b1973dda9695
Author: Yadong Qi <[email protected]>
Date:   2016-09-07T01:26:46Z

    Override sameResult in HiveTableScanExec.

----


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