[
https://issues.apache.org/jira/browse/FLINK-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695034#comment-14695034
]
ASF GitHub Bot commented on FLINK-1901:
---------------------------------------
Github user thvasilo commented on a diff in the pull request:
https://github.com/apache/flink/pull/949#discussion_r36960527
--- Diff:
flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java ---
@@ -451,6 +454,53 @@ protected static File asFile(String path) {
assertEquals(extectedStrings[i], resultStrings[i]);
}
}
+
+ //
--------------------------------------------------------------------------------------------
+ // Comparison methods for tests using sample
+ //
--------------------------------------------------------------------------------------------
+
+ public static <T> void containsResultAsTuples(List<T> result, String
expected) {
+ isExpectedContainsResult(result, expected, true);
+ }
+
+ public static <T> void containsResultAsText(List<T> result, String
expected) {
+ isExpectedContainsResult(result, expected, false);
+ }
+
+ private static <T> void isExpectedContainsResult(List<T> result, String
expected, boolean asTuple) {
--- End diff --
Can we get comments explaining the functionality of this and
`containsResultAsText`?
> Create sample operator for Dataset
> ----------------------------------
>
> Key: FLINK-1901
> URL: https://issues.apache.org/jira/browse/FLINK-1901
> Project: Flink
> Issue Type: Improvement
> Components: Core
> Reporter: Theodore Vasiloudis
> Assignee: Chengxiang Li
>
> In order to be able to implement Stochastic Gradient Descent and a number of
> other machine learning algorithms we need to have a way to take a random
> sample from a Dataset.
> We need to be able to sample with or without replacement from the Dataset,
> choose the relative or exact size of the sample, set a seed for
> reproducibility, and support sampling within iterations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)