ahmedabu98 commented on code in PR #39597:
URL: https://github.com/apache/beam/pull/39597#discussion_r3814966786


##########
sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/BigQueryManagedTableCrossEngineIT.java:
##########
@@ -136,24 +137,47 @@ public void testManagedIcebergReadByThreePartName() 
throws IOException {
             .put(
                 "catalog_properties",
                 ImmutableMap.<String, String>builder()
-                    .put("gcp_project", PROJECT)
-                    .put("gcp_location", connectionLocation())
-                    .put("warehouse", STORAGE_URI_ROOT)
-                    .put("catalog-impl", 
"org.apache.iceberg.gcp.bigquery.BigQueryMetastoreCatalog")
+                    .put("type", "rest")
+                    .put("uri", 
"https://biglake.googleapis.com/iceberg/v1/restcatalog";)
+                    .put(
+                        "warehouse",
+                        String.format(
+                            "bq://projects/%s/locations/%s", PROJECT, 
connectionLocation()))
+                    .put("header.x-goog-user-project", PROJECT)
+                    .put("rest-metrics-reporting-enabled", "false")
                     .put("io-impl", "org.apache.iceberg.gcp.gcs.GCSFileIO")
+                    .put("rest.auth.type", 
"org.apache.iceberg.gcp.auth.GoogleAuthManager")

Review Comment:
   Lakehouse 
[warehouse](https://docs.cloud.google.com/lakehouse/docs/about-iceberg-rest-catalog-endpoint#warehouse-storage-locations)
 names generally start either with `gs://..` or `bl://...`
   ___
   Double checking with Lakehouse folks, but it looks like these managed 
Iceberg tables are actually only readable using the plain hadoop catalog: 
https://docs.cloud.google.com/bigquery/docs/biglake-iceberg-tables-in-bigquery#read-iceberg-tables-from-spark
   
   I think warehouse would point to `STORAGE_URI_ROOT` but check on your end.



##########
sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/BigQueryManagedTableCrossEngineIT.java:
##########
@@ -136,24 +137,47 @@ public void testManagedIcebergReadByThreePartName() 
throws IOException {
             .put(
                 "catalog_properties",
                 ImmutableMap.<String, String>builder()
-                    .put("gcp_project", PROJECT)
-                    .put("gcp_location", connectionLocation())
-                    .put("warehouse", STORAGE_URI_ROOT)
-                    .put("catalog-impl", 
"org.apache.iceberg.gcp.bigquery.BigQueryMetastoreCatalog")
+                    .put("type", "rest")
+                    .put("uri", 
"https://biglake.googleapis.com/iceberg/v1/restcatalog";)
+                    .put(
+                        "warehouse",
+                        String.format(
+                            "bq://projects/%s/locations/%s", PROJECT, 
connectionLocation()))
+                    .put("header.x-goog-user-project", PROJECT)
+                    .put("rest-metrics-reporting-enabled", "false")
                     .put("io-impl", "org.apache.iceberg.gcp.gcs.GCSFileIO")
+                    .put("rest.auth.type", 
"org.apache.iceberg.gcp.auth.GoogleAuthManager")
                     .build())
             .build();
 
+    List<String> expected =
+        LongStream.range(0, 10).mapToObj(i -> i + "|row_" + 
i).collect(Collectors.toList());
+
     Pipeline p = Pipeline.create(TestPipeline.testingPipelineOptions());
-    PCollection<String> rows =
-        p.apply(Managed.read(Managed.ICEBERG).withConfig(config))
+    PCollection<String> icebergRead =
+        p.apply("Iceberg read", 
Managed.read(Managed.ICEBERG).withConfig(config))
             .getSinglePCollection()
             .apply(
+                "canonicalize iceberg",
                 MapElements.into(TypeDescriptors.strings())
                     .via(row -> row.getInt64("id") + "|" + 
row.getString("name")));
-    PAssert.that(rows)
-        .containsInAnyOrder(
-            LongStream.range(0, 10).mapToObj(i -> i + "|row_" + 
i).collect(Collectors.toList()));
+    PAssert.that(icebergRead).containsInAnyOrder(expected);
+
+    // The same table read through the BigQuery lens, addressed 
project.dataset.table.
+    PCollection<String> bigQueryRead =
+        p.apply(
+                "BigQuery read",
+                Managed.read(Managed.BIGQUERY)
+                    .withConfig(
+                        ImmutableMap.of(
+                            "table", String.format("%s.%s.%s", PROJECT, 
DATASET_ID, table))))

Review Comment:
   Checking with Lakehouse on whether PCNT applies to Iceberg Managed Tables. 
If so, we should test it here just for good measure



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to