[ 
https://issues.apache.org/jira/browse/BEAM-3746?focusedWorklogId=155022&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-155022
 ]

ASF GitHub Bot logged work on BEAM-3746:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Oct/18 17:35
            Start Date: 16/Oct/18 17:35
    Worklog Time Spent: 10m 
      Work Description: kennknowles closed pull request #6632: [BEAM-3746] 
Change incompatible message from referencing the output collection to 
referencing the input collection
URL: https://github.com/apache/beam/pull/6632
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/CombineFnBase.java
 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/CombineFnBase.java
index 3756f1fd42d..d2cfaecad0c 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/CombineFnBase.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/CombineFnBase.java
@@ -107,7 +107,7 @@
   abstract static class AbstractGlobalCombineFn<InputT, AccumT, OutputT>
       implements GlobalCombineFn<InputT, AccumT, OutputT>, Serializable {
     private static final String INCOMPATIBLE_GLOBAL_WINDOW_ERROR_MESSAGE =
-        "Default values are not supported in Combine.globally() if the output "
+        "Default values are not supported in Combine.globally() if the input "
             + "PCollection is not windowed by GlobalWindows. Instead, use "
             + "Combine.globally().withoutDefaults() to output an empty 
PCollection if the input "
             + "PCollection is empty, or Combine.globally().asSingletonView() 
to get the default "
diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Top.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Top.java
index 59e569e09a6..354bcb139a3 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Top.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Top.java
@@ -414,10 +414,10 @@ public void populateDisplayData(DisplayData.Builder 
builder) {
 
     @Override
     public String getIncompatibleGlobalWindowErrorMessage() {
-      return "Default values are not supported in Top.[of, smallest, 
largest]() if the output "
+      return "Default values are not supported in Top.[of, smallest, 
largest]() if the input "
           + "PCollection is not windowed by GlobalWindows. Instead, use "
-          + "Top.[of, smallest, largest]().withoutDefaults() to output an 
empty PCollection if the"
-          + " input PCollection is empty, or Top.[of, smallest, 
largest]().asSingletonView() to "
+          + "Top.[of, smallest, largest]().withoutDefaults() to output an 
empty PCollection if the "
+          + "input PCollection is empty, or Top.[of, smallest, 
largest]().asSingletonView() to "
           + "get a PCollection containing the empty list if the input 
PCollection is empty.";
     }
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 155022)
    Time Spent: 3h  (was: 2h 50m)

> Count.globally should override getIncompatibleGlobalWindowErrorMessage to 
> tell the user the usage that is currently only in javadoc
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-3746
>                 URL: https://issues.apache.org/jira/browse/BEAM-3746
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Kenneth Knowles
>            Assignee: Sam Rohde
>            Priority: Major
>              Labels: beginner, newbie, starter
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> https://beam.apache.org/documentation/sdks/javadoc/2.3.0/org/apache/beam/sdk/transforms/Count.html#globally--
> "Note: if the input collection uses a windowing strategy other than 
> GlobalWindows, use Combine.globally(Count.<T>combineFn()).withoutDefaults() 
> instead."
> But the actual crash a user gets is:
> "java.lang.IllegalStateException: Default values are not supported in 
> Combine.globally() if the output PCollection is not windowed by 
> GlobalWindows. Instead, use Combine.globally().withoutDefaults() to output an 
> empty PCollection if the input PCollection is empty, or 
> Combine.globally().asSingletonView() to get the default output of the 
> CombineFn if the input PCollection is empty."
> There is a method that exists solely to make this actually useful, so we 
> should use it!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to