TheNeuralBit commented on a change in pull request #12076:
URL: https://github.com/apache/beam/pull/12076#discussion_r445899639



##########
File path: sdks/python/apache_beam/transforms/sql_test.py
##########
@@ -157,6 +157,21 @@ def test_zetasql_generate_data(self):
           dialect="zetasql")
       assert_that(out, equal_to([(1, "foo", 3.14)]))
 
+  def test_windowing_before_sql(self):
+    with TestPipeline() as p:
+      windowed = (
+          p | beam.Create([
+              SimpleRow(5, "foo", 1.),
+              SimpleRow(15, "bar", 2.),
+              SimpleRow(25, "baz", 3.)
+          ])
+          | beam.Map(lambda v: beam.window.TimestampedValue(v, v.id)).
+          with_output_types(SimpleRow)
+          | beam.WindowInto(
+              beam.window.FixedWindows(10)).with_output_types(SimpleRow)
+          | SqlTransform("SELECT COUNT(*) as `count` FROM PCOLLECTION"))
+      assert_that(out, equal_to([(1, ), (1, ), (1, )]))

Review comment:
       Before the fix it replicates the failure here: 
https://issues.apache.org/jira/browse/BEAM-10143
   
   It fails at execution time because it expects a global window, but receives 
a (correct) interval window




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to