wuchong commented on code in PR #21322:
URL: https://github.com/apache/flink/pull/21322#discussion_r1091369626


##########
flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/basics/DisplayMaxColumnWidthSQLExample.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.examples.java.basics;
+
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.Table;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.config.TableConfigOptions;
+import org.apache.flink.types.Row;
+
+import java.time.LocalDate;
+
+import static org.apache.flink.table.api.Expressions.range;
+import static org.apache.flink.table.api.Expressions.withColumns;
+
+/**
+ * Example for using {@link TableConfigOptions#DISPLAY_MAX_COLUMN_WIDTH}.
+ *
+ * <p>The example shows how to set {@link 
TableConfigOptions#DISPLAY_MAX_COLUMN_WIDTH} show more or
+ * less content of columns with variable-length types (e.g. STRING) in both 
batch and streaming
+ * mode.
+ *
+ * <p>The example executes two Flink jobs. The results are written to stdout.
+ */
+public final class DisplayMaxColumnWidthSQLExample {

Review Comment:
   I'm pretty confused about adding this example. This example is very 
different from others. Examples are usually used to demonstrate a specific use 
case or show how to use a significant feature. I'm not sure we need to add 
examples for each configuration. If this is for verifying, UT and IT are enough.



##########
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/SqlClientOptions.java:
##########
@@ -54,11 +55,13 @@ private SqlClientOptions() {}
 
     // Display options
 
-    @Documentation.TableOption(execMode = Documentation.ExecMode.STREAMING)
+    @Deprecated
+    @Documentation.TableOption(execMode = 
Documentation.ExecMode.BATCH_STREAMING)
     public static final ConfigOption<Integer> DISPLAY_MAX_COLUMN_WIDTH =

Review Comment:
   It seems the `ResultDescriptor#maxColumnWidth` is still using the deprecated 
config. 



##########
flink-table/flink-sql-client/src/test/resources/sql/select.q:
##########
@@ -221,3 +221,72 @@ FROM (VALUES
 
+----------+---------------------+-------------------------+-------------------------------+-------------------------+-------------------------+-------------------------------+
 2 rows in set
 !ok
+
+# ==========================================================================
+# Testing behavior of sql-client.display.max-column-width

Review Comment:
   Add the tests in the above `sql-client.display.max-column-width` section? We 
don't need to re-register `testUserData`. Besides, please verify 
`table.display.max-column-width` should work. It would be better to replace all 
the `sql-client.display.max-column-width` with 
`table.display.max-column-width`, and just add several tests for compatibility 
of `sql-client.display.max-column-width`. 



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