@@ -57,16 +57,10 @@ public class PaimonConversions {
5757 /** Paimon config options set by Fluss should not be set by users. */
5858 @ VisibleForTesting public static final Set <String > PAIMON_UNSETTABLE_OPTIONS = new HashSet <>();
5959
60- @ VisibleForTesting public static final Options PAIMON_DEFAULT_OPTIONS = new Options ();
61-
6260 static {
6361 PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions .BUCKET .key ());
6462 PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions .BUCKET_KEY .key ());
65- PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions .CHANGELOG_PRODUCER .key ());
66-
67- // set partition.legacy-name to false, otherwise paimon will use toString for all types,
68- // which will cause inconsistent partition value for a same binary value
69- PAIMON_DEFAULT_OPTIONS .set (CoreOptions .PARTITION_GENERATE_LEGCY_NAME , false );
63+ PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions .PARTITION_GENERATE_LEGCY_NAME .key ());
7064 }
7165
7266 public static RowKind toRowKind (ChangeType changeType ) {
@@ -120,13 +114,13 @@ public static List<SchemaChange> toPaimonSchemaChanges(List<TableChange> tableCh
120114 TableChange .SetOption setOption = (TableChange .SetOption ) tableChange ;
121115 schemaChanges .add (
122116 SchemaChange .setOption (
123- getFlussPropertyKeyToPaimon (setOption .getKey ()),
117+ convertFlussPropertyKeyToPaimon (setOption .getKey ()),
124118 setOption .getValue ()));
125119 } else if (tableChange instanceof TableChange .ResetOption ) {
126120 TableChange .ResetOption resetOption = (TableChange .ResetOption ) tableChange ;
127121 schemaChanges .add (
128122 SchemaChange .removeOption (
129- getFlussPropertyKeyToPaimon (resetOption .getKey ())));
123+ convertFlussPropertyKeyToPaimon (resetOption .getKey ())));
130124 } else {
131125 throw new UnsupportedOperationException (
132126 "Unsupported table change: " + tableChange .getClass ());
@@ -212,19 +206,20 @@ private static void validatePaimonOptions(Map<String, String> properties) {
212206 if (k .startsWith (PAIMON_CONF_PREFIX )) {
213207 paimonKey = k .substring (PAIMON_CONF_PREFIX .length ());
214208 }
215- if (PAIMON_UNSETTABLE_OPTIONS .contains (paimonKey )
216- || PAIMON_DEFAULT_OPTIONS .toMap ().containsKey (paimonKey )) {
209+ if (PAIMON_UNSETTABLE_OPTIONS .contains (paimonKey )) {
217210 throw new InvalidConfigException (
218211 String .format (
219212 "The Paimon option %s will be set automatically by Fluss "
220- + "and should not set manually." ,
213+ + "and should not be set manually." ,
221214 k ));
222215 }
223216 });
224217 }
225218
226219 private static void setPaimonDefaultProperties (Options options ) {
227- PAIMON_DEFAULT_OPTIONS .toMap ().forEach (options ::set );
220+ // set partition.legacy-name to false, otherwise paimon will use toString for all types,
221+ // which will cause inconsistent partition value for the same binary value
222+ options .set (CoreOptions .PARTITION_GENERATE_LEGCY_NAME , false );
228223 }
229224
230225 private static void setFlussPropertyToPaimon (String key , String value , Options options ) {
@@ -235,7 +230,7 @@ private static void setFlussPropertyToPaimon(String key, String value, Options o
235230 }
236231 }
237232
238- private static String getFlussPropertyKeyToPaimon (String key ) {
233+ private static String convertFlussPropertyKeyToPaimon (String key ) {
239234 if (key .startsWith (PAIMON_CONF_PREFIX )) {
240235 return key .substring (PAIMON_CONF_PREFIX .length ());
241236 } else {
0 commit comments