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



##########
File path: 
sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/DataCatalogTableProvider.java
##########
@@ -178,6 +214,23 @@ private Table toCalciteTable(String tableName, Entry 
entry) {
     return tableBuilder.get().schema(schema).name(tableName).build();
   }
 
+  public boolean setSchemaIfNotPresent(String resource, Schema schema) {

Review comment:
       This really shouldn't be public either, it would be best if this 
functionality was exposed through the existing public API (probably 
DataCatalogTableProvider.createTable). If you'd rather just keep this as-is for 
now, lets mark this function `@Internal` so Beam users don't expect backwards 
compatibility.

##########
File path: 
sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/SchemaUtils.java
##########
@@ -128,18 +128,15 @@ private static ColumnSchema fromBeamField(Schema.Field 
field) {
       }
       ColumnSchema column =
           fromBeamField(Field.of(field.getName(), 
fieldType.getCollectionElementType()));
-      if (!column.getMode().isEmpty()) {

Review comment:
       This assertion could still be there and change to 
`column.getMode().equals("REQUIRED")`




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