leonardBang commented on a change in pull request #13294:
URL: https://github.com/apache/flink/pull/13294#discussion_r484702198



##########
File path: 
flink-formats/flink-json/src/test/java/org/apache/flink/formats/json/canal/CanalJsonFormatFactoryTest.java
##########
@@ -64,44 +64,50 @@
        private static final RowType ROW_TYPE = (RowType) 
SCHEMA.toRowDataType().getLogicalType();
 
        @Test
-       public void testSeDeSchema() {
+       public void testDefaultOptions() {
+               Map<String, String> options = getAllOptions();
 
                // test Deser
-               final CanalJsonDeserializationSchema expectedDeser = new 
CanalJsonDeserializationSchema(
-                       ROW_TYPE,
-                       InternalTypeInfo.of(ROW_TYPE),
-                       true,
-                       TimestampFormat.ISO_8601);
-
-               final Map<String, String> options = getAllOptions();
+               CanalJsonDeserializationSchema expectedDeser = 
CanalJsonDeserializationSchema
+                       .builder(ROW_TYPE, InternalTypeInfo.of(ROW_TYPE))

Review comment:
       This can be reused by declaring static member.

##########
File path: 
flink-formats/flink-json/src/test/java/org/apache/flink/formats/json/canal/CanalJsonSerDeSchemaTest.java
##########
@@ -61,15 +61,29 @@
                FIELD("weight", FLOAT())
        ).getLogicalType();
 
+       @Test
+       public void testFilteringTables() throws Exception {
+               List<String> lines = readLines("canal-data-filter-table.txt");
+               CanalJsonDeserializationSchema deserializationSchema = 
CanalJsonDeserializationSchema
+                       .builder(SCHEMA, InternalTypeInfo.of(SCHEMA))

Review comment:
       `InternalTypeInfo.of(SCHEMA)` can be reused by declaring static member.
   
   

##########
File path: docs/dev/table/connectors/formats/canal.zh.md
##########
@@ -183,6 +183,20 @@ Format 参数
        </ul>
        </td>
     </tr>
+    <tr>
+      <td><h5>canal-json.database</h5></td>
+      <td>optional</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>仅读取匹配所指定数据库的 changelog 记录(通过对比 Canal 记录中的 "database" 元数据字段)。

Review comment:
       How about the following translation?
   ```suggestion
         <td>仅读取指定数据库的 changelog 记录(通过对比 Canal 记录中的 "database" 元数据字段)。
   ```
   

##########
File path: docs/dev/table/connectors/formats/canal.zh.md
##########
@@ -183,6 +183,20 @@ Format 参数
        </ul>
        </td>
     </tr>
+    <tr>
+      <td><h5>canal-json.database</h5></td>
+      <td>optional</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>仅读取匹配所指定数据库的 changelog 记录(通过对比 Canal 记录中的 "database" 元数据字段)。
+    </tr>
+    <tr>
+      <td><h5>canal-json.table</h5></td>
+      <td>optional</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>仅读取匹配所指定表的 changelog 记录(通过对比 Canal 记录中的 "table" 元数据字段)。

Review comment:
       How about the following translation?
   ```suggestion
         <td>仅读取指定表的 changelog 记录(通过对比 Canal 记录中的 "table" 元数据字段)。
   ```




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


Reply via email to