Skip to content

Commit b403d65

Browse files
author
Dai MIKURUBE
committed
Add a test for merging time formats
1 parent 41ceaab commit b403d65

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

embulk-guess-csv/src/test/java/org/embulk/standards/guess/TestCsvGuessPlugin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ public void testComplex() throws Exception {
8181
"test_complex_guessed.yml");
8282
}
8383

84+
@Test
85+
public void testMergeTimeFormats() throws Exception {
86+
assertGuessByResource(embulk,
87+
"test_merge_time_formats_seed.yml", "test_merge_time_formats.csv",
88+
"test_merge_time_formats_guessed.yml");
89+
}
90+
8491
@Test
8592
public void testFor1Rows() throws Exception {
8693
assertGuessByResource(embulk,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
time,name
2+
2021-12-1 24:30:30,"foo bar"
3+
2021-12-1 4:30:30,foo
4+
2021-12-1 24:30:30,bar
5+
2021-12-1 24:30:30,baz
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
charset: UTF-8
2+
newline: LF
3+
quote: '"'
4+
type: csv
5+
delimiter: ','
6+
escape: '"'
7+
trim_if_not_quoted: false
8+
skip_header_lines: 1
9+
allow_extra_columns: false
10+
allow_optional_columns: false
11+
columns:
12+
- {"name": "time", "type": "timestamp", "format": "%Y-%m-%d %k:%M:%S"}
13+
- {"name": "name", "type": "string"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)