KurtYoung commented on a change in pull request #8844:
[FLINK-12951][table-planner] Add logic to bridge DDL to table source(…
URL: https://github.com/apache/flink/pull/8844#discussion_r299854677
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
##########
@@ -304,6 +304,22 @@ public Builder() {
fieldDataTypes = new ArrayList<>();
}
+ /** Create a proto builder from an existing schema.
+ *
+ * <p>Caution: This will invoke {@link #instance()}} to fetch a
new builder first.
+ */
+ public Builder proto(TableSchema other) {
+ Builder builder = instance();
+
builder.fieldNames.addAll(Arrays.asList(other.getFieldNames()));
+
builder.fieldDataTypes.addAll(Arrays.asList(other.getFieldDataTypes()));
+ return builder;
+ }
+
+ /** Returns a new builder instance. **/
+ public static Builder instance() {
Review comment:
why don't you just new?
----------------------------------------------------------------
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]
With regards,
Apache Git Services