xxsc0529 commented on code in PR #10700: URL: https://github.com/apache/inlong/pull/10700#discussion_r1689188362
########## inlong-sort/sort-core/src/test/java/org/apache/inlong/sort/parser/MySqlExtractNodeToOceanBaseLoadNodeTest.java: ########## @@ -0,0 +1,138 @@ +/* + * 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.inlong.sort.parser; + +import org.apache.inlong.common.pojo.sort.dataflow.field.format.IntFormatInfo; +import org.apache.inlong.common.pojo.sort.dataflow.field.format.StringFormatInfo; +import org.apache.inlong.sort.parser.impl.FlinkSqlParser; +import org.apache.inlong.sort.parser.result.ParseResult; +import org.apache.inlong.sort.protocol.FieldInfo; +import org.apache.inlong.sort.protocol.GroupInfo; +import org.apache.inlong.sort.protocol.StreamInfo; +import org.apache.inlong.sort.protocol.node.Node; +import org.apache.inlong.sort.protocol.node.extract.MySqlExtractNode; +import org.apache.inlong.sort.protocol.node.load.OceanBaseLoadNode; +import org.apache.inlong.sort.protocol.transformation.FieldRelation; +import org.apache.inlong.sort.protocol.transformation.FilterFunction; +import org.apache.inlong.sort.protocol.transformation.relation.NodeRelation; + +import lombok.extern.slf4j.Slf4j; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.table.api.EnvironmentSettings; +import org.apache.flink.table.api.bridge.java.StreamTableEnvironment; +import org.apache.flink.test.util.AbstractTestBase; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Test mysql cdc for {@link OceanBaseLoadNode} + */ +@Slf4j +public class MySqlExtractNodeToOceanBaseLoadNodeTest extends AbstractTestBase { + + private MySqlExtractNode buildMysqlExtractNode() { + List<FieldInfo> fields = Arrays.asList( + new FieldInfo("id", new IntFormatInfo()), + new FieldInfo("user_name", new StringFormatInfo()), + new FieldInfo("phone", new StringFormatInfo())); + Map<String, String> map = new HashMap<>(); + return new MySqlExtractNode("1", "mysql_input", fields, + null, map, "id", + Collections.singletonList("t_ds_user"), "localhost", "root", "root", + "dolphinscheduler", 3308, 10011, + true, null); + } + + private OceanBaseLoadNode buildMysqlLoadNode() { + final List<FieldInfo> fields = Arrays.asList( + new FieldInfo("id", new IntFormatInfo()), + new FieldInfo("user_name", new StringFormatInfo()), + new FieldInfo("phone", new StringFormatInfo())); + + final List<FieldRelation> fieldRelations = Arrays + .asList(new FieldRelation(new FieldInfo("id", new IntFormatInfo()), + new FieldInfo("id", new IntFormatInfo())), + new FieldRelation(new FieldInfo("user_name", new StringFormatInfo()), + new FieldInfo("user_name", new StringFormatInfo())), + new FieldRelation(new FieldInfo("phone", new IntFormatInfo()), + new FieldInfo("phone", new IntFormatInfo()))); + + // Support delete event (sink.enable-delete='true'), requires Doris table to enable batch delete function Review Comment: has been modified -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org