rdblue commented on code in PR #6598:
URL: https://github.com/apache/iceberg/pull/6598#discussion_r1092354135


##########
api/src/main/java/org/apache/iceberg/view/ViewRepresentation.java:
##########
@@ -18,21 +18,16 @@
  */
 package org.apache.iceberg.view;
 
-import java.util.Locale;
+import org.immutables.value.Value;
 
+@Value.Immutable
 public interface ViewRepresentation {
 
-  enum Type {
-    SQL;
+  class Type {
+    private Type() {}
 
-    public static Type fromString(String typeName) {
-      return valueOf(typeName.toUpperCase(Locale.ENGLISH));
-    }
-
-    public String typeName() {
-      return name().toLowerCase(Locale.ENGLISH);
-    }
+    public static final String SQL = "sql";

Review Comment:
   I think it depends on whether we want to use this enum in switch statements 
in our code or if we want to extend it. For example, we could have a reference 
to the parser in the enum so we look up the symbol and then call something like 
`ViewRepresentation.SQL.parse(jsonNode)`.
   
   Since we only have the parser selection right now, it doesn't seem like it 
matters much.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to