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


##########
api/src/main/java/org/apache/iceberg/view/ViewBuilder.java:
##########
@@ -39,60 +38,25 @@ public interface ViewBuilder {
   ViewBuilder withSchema(Schema schema);
 
   /**
-   * Set the view query.
+   * Add a view representation for the given dialect and the SQL to the view.
    *
-   * @param query view query
+   * @param dialect The dialect of the view representation
+   * @param sql The SQL of the view representation
    * @return this for method chaining
    */
-  ViewBuilder withQuery(String query);
+  default ViewBuilder withQuery(String dialect, String sql) {
+    return withQuery(dialect, sql, null);
+  }
 
   /**
-   * Set the view SQL dialect.
+   * Add a view representation for the given dialect and the SQL to the view.
    *
-   * @param dialect view SQL dialect
+   * @param dialect The dialect of the view representation
+   * @param sql The SQL of the view representation
+   * @param defaultNamespace The default namespace to use when the SQL does 
not contain a namespace
    * @return this for method chaining
    */
-  ViewBuilder withDialect(String dialect);
-
-  /**
-   * Set the view default catalog.
-   *
-   * @param defaultCatalog view default catalog
-   * @return this for method chaining
-   */
-  ViewBuilder withDefaultCatalog(String defaultCatalog);
-
-  /**
-   * Set the view default namespace.
-   *
-   * @param defaultNamespace view default namespace
-   * @return this for method chaining
-   */
-  ViewBuilder withDefaultNamespace(Namespace defaultNamespace);
-
-  /**
-   * Set the view query column names.
-   *
-   * @param queryColumnNames view query column names
-   * @return this for method chaining
-   */
-  ViewBuilder withQueryColumnNames(List<String> queryColumnNames);
-
-  /**
-   * Set the view field aliases.
-   *
-   * @param fieldAliases view field aliases
-   * @return this for method chaining
-   */
-  ViewBuilder withFieldAliases(List<String> fieldAliases);
-
-  /**
-   * Set the view field comments.
-   *
-   * @param fieldComments view field comments
-   * @return this for method chaining
-   */
-  ViewBuilder withFieldComments(List<String> fieldComments);
+  ViewBuilder withQuery(String dialect, String sql, Namespace 
defaultNamespace);

Review Comment:
   @nastra, what we talked about was that this should be a property of the 
`ViewVersion`, not the SQL. You can't define two SQL queries with different 
default namespaces.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to