GitHub user dongjoon-hyun opened a pull request:

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

    [SPARK-15709][SQL] Prevent `freqItems` from raising 
`UnsupportedOperationException: empty.min`

    ## What changes were proposed in this pull request?
    
    Currently, `freqItems` raises `UnsupportedOperationException` on 
`empty.min` usually when its `support` argument is high.
    ```scala
    scala> spark.createDataset(Seq(1, 2, 2, 3, 3, 
3)).stat.freqItems(Seq("value"), 2)
    16/06/01 11:11:38 ERROR Executor: Exception in task 5.0 in stage 0.0 (TID 5)
    java.lang.UnsupportedOperationException: empty.min
    ...
    ```
    
    Also, the parameter checking message is wrong.
    ```
    require(support >= 1e-4, s"support ($support) must be greater than 1e-4.")
    ```
    
    This PR changes the logic to handle the `empty` case and also improves 
parameter checking.
    
    ## How was this patch tested?
    
    Pass the Jenkins tests (with a new testcase).

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

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-15709

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

    https://github.com/apache/spark/pull/13449.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 #13449
    
----

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to