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

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

                Author: ASF GitHub Bot
            Created on: 08/Mar/21 22:07
            Start Date: 08/Mar/21 22:07
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on a change in pull request #13980:
URL: https://github.com/apache/beam/pull/13980#discussion_r589782708



##########
File path: 
sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/pubsub/PubsubTableProviderIT.java
##########
@@ -177,6 +177,125 @@ public void testSQLSelectsPayloadContent() throws 
Exception {
     resultSignal.waitForSuccess(Duration.standardMinutes(5));
   }
 
+  @Test
+  public void testSQLSelectsArrayAttributes() throws Exception {
+    String createTableString =
+        String.format(
+            "CREATE EXTERNAL TABLE message (\n"
+                + "event_timestamp TIMESTAMP, \n"
+                + "attributes ARRAY<ROW<key VARCHAR, `value` VARCHAR>>, \n"
+                + "payload ROW< \n"
+                + "             id INTEGER, \n"
+                + "             name VARCHAR \n"
+                + "           > \n"
+                + ") \n"
+                + "TYPE '%s' \n"
+                + "LOCATION '%s' \n"
+                + "TBLPROPERTIES '{ "
+                + "%s"
+                + "\"timestampAttributeKey\" : \"ts\" }'",
+            tableProvider.getTableType(), eventsTopic.topicPath(), 
payloadFormatParam());
+
+    String queryString = "SELECT message.payload.id, attributes[0].key AS name 
FROM message";

Review comment:
       You want `attributes[1].key`. SQL arrays are 1-indexed.




----------------------------------------------------------------
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]


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

    Worklog Id:     (was: 562630)
    Time Spent: 23h 20m  (was: 23h 10m)

> Integrate Pub/Sub Lite with beam SQL
> ------------------------------------
>
>                 Key: BEAM-11659
>                 URL: https://issues.apache.org/jira/browse/BEAM-11659
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql, io-java-gcp
>            Reporter: Daniel Collins
>            Assignee: Daniel Collins
>            Priority: P2
>          Time Spent: 23h 20m
>  Remaining Estimate: 0h
>
> Pub/Sub Lite should be a valid source and sink for beam SQL.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to