wuchong commented on a change in pull request #16588:
URL: https://github.com/apache/flink/pull/16588#discussion_r677391024



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Column.java
##########
@@ -48,9 +48,7 @@
     protected final @Nullable String comment;
 
     private Column(String name, DataType dataType) {
-        this.name = name;
-        this.dataType = dataType;
-        this.comment = null;
+        this(name, dataType, null);

Review comment:
       This constructor can be removed now. 

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
##########
@@ -226,6 +226,8 @@ public Builder withComment(@Nullable String comment) {
             if (columns.size() > 0) {
                 columns.set(
                         columns.size() - 1, columns.get(columns.size() - 
1).withComment(comment));
+            } else {
+                throw new IllegalArgumentException("There is no preceding 
column defined.");

Review comment:
       ```suggestion
                   throw new IllegalArgumentException("Method \"withComment\" 
must be followed by a column definition, but there is no preceding column 
defined.");
   ```

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
##########
@@ -632,8 +634,7 @@ private void addResolvedConstraint(UniqueConstraint 
constraint) {
         final @Nullable String comment;
 
         UnresolvedColumn(String columnName) {

Review comment:
       This method can be removed now. 




-- 
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...@flink.apache.org

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


Reply via email to