GitHub user dilipbiswal opened a pull request:

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

    [SPARK-25610][SQL][TEST] Improve execution time of DatasetCacheSuite: cache 
UDF result correctly

    ## What changes were proposed in this pull request?
    In this test case, we are verifying that the result of an UDF  is cached 
when the underlying data frame is cached and that the udf is not evaluated 
again when the cached data frame is used.
    
    To reduce the runtime we do : 
    1) Use a single partition dataframe, so the total execution time of UDF is 
more deterministic.
    2) Cut down the size of the dataframe from 10 to 2.
    3) Reduce the sleep time in the UDF from 5secs to 2secs.
    4) Reduce the failafter condition from 3 to 2.
    
    With the above change, it takes about 4 secs to cache the first dataframe. 
And subsequent check takes a few hundred milliseconds.
    The new runtime for 5 consecutive runs of this test is as follows : 
    ```
    [info] - cache UDF result correctly (4 seconds, 906 milliseconds)
    [info] - cache UDF result correctly (4 seconds, 281 milliseconds)
    [info] - cache UDF result correctly (4 seconds, 288 milliseconds)
    [info] - cache UDF result correctly (4 seconds, 355 milliseconds)
    [info] - cache UDF result correctly (4 seconds, 280 milliseconds)
    ```
    ## How was this patch tested?
    This is s test fix.

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

    $ git pull https://github.com/dilipbiswal/spark SPARK-25610

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

    https://github.com/apache/spark/pull/22638.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 #22638
    
----
commit 97d18feeb8713da42b9f97d2343063bac1cba4b6
Author: Dilip Biswal <dbiswal@...>
Date:   2018-10-05T07:51:35Z

    [SPARK-25610][TEST] Improve execution time of DatasetCacheSuite: cache UDF 
result correctly

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to