Skip to content

Commit 9c81573

Browse files
authored
[lake/paimon] Support passing Fluss table comment through to the Paimon table (#1999)
1 parent 3f8797c commit 9c81573

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

fluss-lake/fluss-lake-paimon/src/main/java/org/apache/fluss/lake/paimon/utils/PaimonConversions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ public static Schema toPaimonSchema(TableDescriptor tableDescriptor) {
203203
.getCustomProperties()
204204
.forEach((k, v) -> setFlussPropertyToPaimon(k, v, options));
205205
schemaBuilder.options(options.toMap());
206+
207+
// set comment
208+
tableDescriptor.getComment().ifPresent(schemaBuilder::comment);
209+
206210
return schemaBuilder.build();
207211
}
208212

fluss-lake/fluss-lake-paimon/src/test/java/org/apache/fluss/lake/paimon/LakeEnabledTableCreateITCase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ void testCreateLakeEnabledTable() throws Exception {
151151
.property(ConfigOptions.TABLE_DATALAKE_ENABLED, true)
152152
.customProperties(customProperties)
153153
.distributedBy(BUCKET_NUM, "log_c1", "log_c2")
154+
.comment("test comment")
154155
.build();
155156
TablePath logTablePath = TablePath.of(DATABASE, "log_table");
156157
admin.createTable(logTablePath, logTable, false).get();
@@ -902,6 +903,8 @@ private void verifyPaimonTable(
902903
// now, check schema
903904
RowType paimonRowType = paimonTable.rowType();
904905
assertThat(paimonRowType).isEqualTo(expectedRowType);
906+
907+
assertThat(paimonTable.comment()).isEqualTo(flussTable.getComment());
905908
}
906909

907910
private TableDescriptor createTableDescriptor(

0 commit comments

Comments
 (0)