This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new a05e8f98c5 [format] Support delimiter as fallback key of
csv.field-delimiter (#9170)
a05e8f98c5 is described below
commit a05e8f98c54781dc2aa30e6b7ca397237b7c6c84
Author: Zouxxyy <[email protected]>
AuthorDate: Tue Aug 11 19:19:50 2026 +0800
[format] Support delimiter as fallback key of csv.field-delimiter (#9170)
---
.../org/apache/paimon/format/csv/CsvOptions.java | 2 +-
.../paimon/format/csv/CsvFileFormatTest.java | 26 ++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git
a/paimon-format/src/main/java/org/apache/paimon/format/csv/CsvOptions.java
b/paimon-format/src/main/java/org/apache/paimon/format/csv/CsvOptions.java
index e0ad2d0d91..c6261415a7 100644
--- a/paimon-format/src/main/java/org/apache/paimon/format/csv/CsvOptions.java
+++ b/paimon-format/src/main/java/org/apache/paimon/format/csv/CsvOptions.java
@@ -33,7 +33,7 @@ public class CsvOptions {
ConfigOptions.key("csv.field-delimiter")
.stringType()
.defaultValue(",")
- .withFallbackKeys("field-delimiter", "seq")
+ .withFallbackKeys("field-delimiter", "seq", "delimiter")
.withDescription("The field delimiter for CSV or TXT
format");
public static final ConfigOption<String> LINE_DELIMITER =
diff --git
a/paimon-format/src/test/java/org/apache/paimon/format/csv/CsvFileFormatTest.java
b/paimon-format/src/test/java/org/apache/paimon/format/csv/CsvFileFormatTest.java
index 10982d448a..cda6b3ead7 100644
---
a/paimon-format/src/test/java/org/apache/paimon/format/csv/CsvFileFormatTest.java
+++
b/paimon-format/src/test/java/org/apache/paimon/format/csv/CsvFileFormatTest.java
@@ -203,6 +203,32 @@ public class CsvFileFormatTest extends FormatReadWriteTest
{
}
}
+ @Test
+ public void testCsvFieldDelimiterFallbackKeys() throws IOException {
+ RowType rowType = DataTypes.ROW(DataTypes.INT().notNull(),
DataTypes.STRING());
+
+ List<InternalRow> testData =
+ Arrays.asList(
+ GenericRow.of(1, BinaryString.fromString("Alice")),
+ GenericRow.of(2, BinaryString.fromString("Bob")));
+
+ for (String fallbackKey : new String[] {"field-delimiter", "seq",
"delimiter"}) {
+ Options options = new Options();
+ options.set(fallbackKey, ";");
+
+ assertThat(options.get(CsvOptions.FIELD_DELIMITER)).isEqualTo(";");
+
+ List<InternalRow> result =
+ writeThenRead(options, rowType, rowType, testData, "test_"
+ fallbackKey);
+
+ assertThat(result).hasSize(2);
+ assertThat(result.get(0).getInt(0)).isEqualTo(1);
+
assertThat(result.get(0).getString(1).toString()).isEqualTo("Alice");
+ assertThat(result.get(1).getInt(0)).isEqualTo(2);
+ assertThat(result.get(1).getString(1).toString()).isEqualTo("Bob");
+ }
+ }
+
@Test
public void testCsvLineDelimiterWriteRead() throws IOException {
RowType rowType = DataTypes.ROW(DataTypes.INT().notNull(),
DataTypes.STRING());