wuchong commented on a change in pull request #9328: [FLINK-13521][sql-client] 
Allow setting configurations in SQL CLI
URL: https://github.com/apache/flink/pull/9328#discussion_r309991508
 
 

 ##########
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##########
 @@ -0,0 +1,154 @@
+################################################################################
+#  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.
+################################################################################
+
+#==============================================================================
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==============================================================================
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
+  - name: TableNumber1
+    type: source-table
+    $VAR_UPDATE_MODE
+    schema:
+      - name: IntegerField1
+        type: INT
+      - name: StringField1
+        type: VARCHAR
+    connector:
+      type: filesystem
+      path: "$VAR_SOURCE_PATH1"
+    format:
+      type: csv
+      fields:
+        - name: IntegerField1
+          type: INT
+        - name: StringField1
+          type: VARCHAR
+      line-delimiter: "\n"
+      comment-prefix: "#"
+  - name: TestView1
+    type: view
+    query: SELECT scalarUDF(IntegerField1) FROM TableNumber1
+  - name: TableNumber2
+    # Test backwards compatibility ("source" -> "source-table")
+    type: source
+    $VAR_UPDATE_MODE
+    schema:
+      - name: IntegerField2
+        type: INT
+      - name: StringField2
+        type: VARCHAR
+    connector:
+      type: filesystem
+      path: "$VAR_SOURCE_PATH2"
+    format:
+      type: csv
+      fields:
+        - name: IntegerField2
+          type: INT
+        - name: StringField2
+          type: VARCHAR
+      line-delimiter: "\n"
+      comment-prefix: "#"
+  - name: TableSourceSink
+    type: source-sink-table
+    $VAR_UPDATE_MODE
+    schema:
+      - name: BooleanField
+        type: BOOLEAN
+      - name: StringField
+        type: VARCHAR
+    connector:
+      type: filesystem
+      path: "$VAR_SOURCE_SINK_PATH"
+    format:
+      type: csv
+      fields:
+        - name: BooleanField
+          type: BOOLEAN
+        - name: StringField
+          type: VARCHAR
+  - name: TestView2
+    type: view
+    query: SELECT * FROM TestView1
+
+functions:
+  - name: scalarUDF
+    from: class
+    class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$ScalarUDF
+    constructor:
+      - 5
+  - name: aggregateUDF
+    from: class
+    class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$AggregateUDF
+    constructor:
+      - StarryName
+      - false
+      - class: java.lang.Integer
+        constructor:
+          - class: java.lang.String
+            constructor:
+              - type: VARCHAR
+                value: 3
+  - name: tableUDF
+    from: class
+    class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$TableUDF
+    constructor:
+      - type: LONG
+        value: 5
+
+catalogs:
+  - name: catalog1
+    type: DependencyTest
+  - name: simple-catalog
+    type: simple-catalog
+    test-table: test-table
+
+execution:
+  planner: "$VAR_PLANNER"
+  type: "$VAR_EXECUTION_TYPE"
+  time-characteristic: event-time
+  periodic-watermarks-interval: 99
+  parallelism: 1
+  max-parallelism: 16
+  min-idle-state-retention: 0
+  max-idle-state-retention: 0
+  result-mode: "$VAR_RESULT_MODE"
+  max-table-result-rows: "$VAR_MAX_ROWS"
+  restart-strategy:
+    type: failure-rate
+    max-failures-per-interval: 10
+    failure-rate-interval: 99000
+    delay: 1000
+
+deployment:
+  response-timeout: 5000
+
+configuration:
+  table:
+    exec:
+      sort:
+        default-limit: "$SORT_DEFAULT_LIMIT"
+      spill-compression:
+        enabled: true
+        block-size: 128kb
+    optimizer:
+      join-reorder-enabled: true
 
 Review comment:
   Oh, I want to avoid to set configurations in yaml in this way. It is too 
hard to split the keys into hierarchic level. 
   Could we just use plain keys to set configuration? 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to