dpcollins-google commented on a change in pull request #13980:
URL: https://github.com/apache/beam/pull/13980#discussion_r590362698



##########
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:
       Good to know! I restructured this test to use 1 indexing.




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