[GitHub] spark pull request #18642: [MINOR][REFACTORING] KeyValueGroupedDataset.mapGr...
Github user asfgit closed the pull request at: https://github.com/apache/spark/pull/18642 --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #18642: [MINOR][REFACTORING] KeyValueGroupedDataset.mapGr...
Github user zsxwing commented on a diff in the pull request: https://github.com/apache/spark/pull/18642#discussion_r128632530 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala --- @@ -242,16 +242,7 @@ class KeyValueGroupedDataset[K, V] private[sql]( def mapGroupsWithState[S: Encoder, U: Encoder]( func: (K, Iterator[V], GroupState[S]) => U): Dataset[U] = { val flatMapFunc = (key: K, it: Iterator[V], s: GroupState[S]) => Iterator(func(key, it, s)) -Dataset[U]( - sparkSession, - FlatMapGroupsWithState[K, V, S, U]( -flatMapFunc.asInstanceOf[(Any, Iterator[Any], LogicalGroupState[Any]) => Iterator[Any]], -groupingAttributes, -dataAttributes, -OutputMode.Update, -isMapGroupsWithState = true, --- End diff -- This change is not correct. It will set `isMapGroupsWithState` to `false`. However, looks like we don't have a unit test covering this :( --- 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
[GitHub] spark pull request #18642: [MINOR][REFACTORING] KeyValueGroupedDataset.mapGr...
GitHub user jaceklaskowski opened a pull request: https://github.com/apache/spark/pull/18642 [MINOR][REFACTORING] KeyValueGroupedDataset.mapGroupsWithState uses flatMapGroupsWithState ## What changes were proposed in this pull request? Refactored `KeyValueGroupedDataset.mapGroupsWithState` to use `flatMapGroupsWithState` explicitly (so it's clear that the former is almost the latter). ## How was this patch tested? local build You can merge this pull request into a Git repository by running: $ git pull https://github.com/jaceklaskowski/spark mapGroupsWithState Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/18642.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 #18642 commit ce51466411983181b52cac07610d2bece2ffc5e8 Author: Jacek Laskowski Date: 2017-07-15T09:31:55Z [MINOR][REFACTORING] KeyValueGroupedDataset.mapGroupsWithState uses flatMapGroupsWithState --- 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