ebyhr commented on code in PR #216:
URL: https://github.com/apache/polaris/pull/216#discussion_r1733944071


##########
polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisSparkIntegrationTest.java:
##########
@@ -346,6 +350,20 @@ public void testCreateAndUpdateExternalTable() {
     assertThat(rowCount).isEqualTo(4);
   }
 
+  @Test
+  public void testCreateView() {
+    long namespaceCount = onSpark("SHOW NAMESPACES").count();
+    assertThat(namespaceCount).isEqualTo(0L);
+
+    onSpark("CREATE NAMESPACE ns1");
+    onSpark("USE ns1");
+    onSpark("CREATE TABLE tb1 (col1 integer, col2 string)");
+    onSpark("INSERT INTO tb1 VALUES (1, 'a'), (2, 'b'), (3, 'c')");
+    onSpark("CREATE VIEW view1 as select * from tb1");

Review Comment:
   ```suggestion
       onSpark("CREATE VIEW view1 AS SELECT * FROM tb1");
   ```



##########
polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -1143,12 +1143,18 @@ private class BasePolarisCatalogViewBuilder extends 
BaseMetastoreViewCatalog.Bas
 
     public BasePolarisCatalogViewBuilder(TableIdentifier identifier) {
       super(identifier);
+      withProperties(viewDefaultProperties());
     }
 
     @Override
     public ViewBuilder withLocation(String newLocation) {
       return super.withLocation(transformTableLikeLocation(newLocation));
     }
+
+    private Map<String, String> viewDefaultProperties() {
+      Map<String, String> viewDefaultProperties = 
PropertyUtil.propertiesWithPrefix(BasePolarisCatalog.this.properties(), 
"table-default.");
+      return viewDefaultProperties;
+    }

Review Comment:
   Why do we want to have a separate method for such a simple logic? 



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