Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E2E Test][Improvement] Add Test Case for LocalFile CSV Sink #8436

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,15 @@ public class LocalFileIT extends TestSuiteBase {
};

@TestTemplate
@DisabledOnContainer(
value = {TestContainerId.SPARK_2_4},
type = {EngineType.SPARK, EngineType.FLINK},
disabledReason =
"Fink test is multi-node, LocalFile connector will use different containers for obtaining files")
public void testLocalFileReadAndWrite(TestContainer container)
throws IOException, InterruptedException {
TestHelper helper = new TestHelper(container);
helper.execute("/excel/fake_to_local_csv.conf");
helper.execute("/excel/fake_to_local_excel.conf");
helper.execute("/excel/local_excel_to_assert.conf");
helper.execute("/excel/local_excel_projection_to_assert.conf");
Expand Down Expand Up @@ -391,7 +397,7 @@ public void testLocalFileReadAndWrite(TestContainer container)
@TestTemplate
@DisabledOnContainer(
value = {TestContainerId.SPARK_2_4},
type = {EngineType.FLINK},
type = {EngineType.SPARK, EngineType.FLINK},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why disabled spark

disabledReason =
"Fink test is multi-node, LocalFile connector will use different containers for obtaining files")
public void testLocalFileReadAndWriteWithSaveMode(TestContainer container)
Expand Down Expand Up @@ -437,6 +443,11 @@ private List<String> getFileListFromContainer(String path) {
}

@TestTemplate
@DisabledOnContainer(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

value = {TestContainerId.SPARK_2_4},
type = {EngineType.SPARK, EngineType.FLINK},
disabledReason =
"Fink test is multi-node, LocalFile connector will use different containers for obtaining files")
public void testLocalFileCatalog(TestContainer container)
throws IOException, InterruptedException {
final LocalFileCatalog localFileCatalog =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# 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 {
parallelism = 1
job.mode = "BATCH"

# You can set spark configuration here
spark.app.name = "SeaTunnel"
spark.executor.instances = 2
spark.executor.cores = 1
spark.executor.memory = "1g"
spark.master = local
}

source {
FakeSource {
plugin_output = "fake"
schema = {
fields {
c_map = "map<string, string>"
c_array = "array<int>"
c_string = string
c_boolean = boolean
c_tinyint = tinyint
c_smallint = smallint
c_int = int
c_bigint = bigint
c_float = float
c_double = double
c_bytes = bytes
c_date = date
c_decimal = "decimal(38, 18)"
c_timestamp = timestamp
c_row = {
c_map = "map<string, string>"
c_array = "array<int>"
c_string = string
c_boolean = boolean
c_tinyint = tinyint
c_smallint = smallint
c_int = int
c_bigint = bigint
c_float = float
c_double = double
c_bytes = bytes
c_date = date
c_decimal = "decimal(38, 18)"
c_timestamp = timestamp
}
}
}
}
}

sink {
LocalFile {
path = "/tmp/seatunnel/csv"
partition_dir_expression = "${k0}=${v0}"
is_partition_field_write_in_file = true
file_name_expression = "${transactionId}_${now}"
file_format_type = "csv"
filename_time_format = "yyyy.MM.dd"
is_enable_transaction = true
}
}
Loading