From bd5be566449e110f5cbd73217f19328a9886f874 Mon Sep 17 00:00:00 2001 From: tyrantlucifer Date: Tue, 16 May 2023 23:01:02 +0800 Subject: [PATCH] [Feature][Connector-V2][Paimon] Add paimon read IT case --- .../e2e/connector/paimon/PaimonIT.java | 4 +- .../src/test/resources/paimon_to_assert.conf | 72 +++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/resources/paimon_to_assert.conf diff --git a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonIT.java b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonIT.java index bc45abb470d2..5ec64f8fb841 100644 --- a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonIT.java +++ b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonIT.java @@ -52,9 +52,11 @@ public class PaimonIT extends TestSuiteBase { }; @TestTemplate - public void testWriteToPaimon(TestContainer container) + public void testWriteAndReadPaimon(TestContainer container) throws IOException, InterruptedException { Container.ExecResult textWriteResult = container.executeJob("/fake_to_paimon.conf"); Assertions.assertEquals(0, textWriteResult.getExitCode()); + Container.ExecResult readResult = container.executeJob("/paimon_to_assert.conf"); + Assertions.assertEquals(0, readResult.getExitCode()); } } diff --git a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/resources/paimon_to_assert.conf b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/resources/paimon_to_assert.conf new file mode 100644 index 000000000000..1a1021852d08 --- /dev/null +++ b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/resources/paimon_to_assert.conf @@ -0,0 +1,72 @@ +# +# 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. +# + +env { + execution.parallelism = 1 + spark.app.name = "SeaTunnel" + spark.executor.instances = 2 + spark.executor.cores = 1 + spark.executor.memory = "1g" + spark.master = local + job.mode = "BATCH" +} + +source { + Paimon { + warehouse = "/tmp/paimon" + database = "default" + table = "st_test" + result_table_name = paimon_source + } +} + +sink { + Console { + source_table_name = paimon_source + } + Assert { + source_table_name = paimon_source + rules { + row_rules = [ + { + rule_type = MAX_ROW + rule_value = 5 + } + ], + field_rules = [ + { + field_name = c_string + field_type = string + filed_value = [ + { + rule_type = NOT_NULL + } + ] + }, + { + field_name = c_boolean + field_type = boolean + filed_value = [ + { + rule_type = NOT_NULL + } + ] + } + ] + } + } +} \ No newline at end of file