4949/** Utils for conversion between Paimon and Fluss. */
5050public class PaimonConversions {
5151
52+ // use literal directly, a future paimon version will rename
53+ // the variable PARTITION_GENERATE_LEGCY_NAME to PARTITION_GENERATE_LEGACY_NAME, use literal
54+ // can help avoid NoSuchField error
55+ // todo: after upgrade paimon version, we call fall back to use PARTITION_GENERATE_LEGACY_NAME
56+ // again
57+ private static final String PARTITION_GENERATE_LEGACY_NAME_OPTION_KEY = "partition.legacy-name" ;
58+
5259 // for fluss config
5360 private static final String FLUSS_CONF_PREFIX = "fluss." ;
5461 // for paimon config
@@ -60,7 +67,7 @@ public class PaimonConversions {
6067 static {
6168 PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions .BUCKET .key ());
6269 PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions .BUCKET_KEY .key ());
63- PAIMON_UNSETTABLE_OPTIONS .add (CoreOptions . PARTITION_GENERATE_LEGCY_NAME . key () );
70+ PAIMON_UNSETTABLE_OPTIONS .add (PARTITION_GENERATE_LEGACY_NAME_OPTION_KEY );
6471 }
6572
6673 public static RowKind toRowKind (ChangeType changeType ) {
@@ -219,7 +226,7 @@ private static void validatePaimonOptions(Map<String, String> properties) {
219226 private static void setPaimonDefaultProperties (Options options ) {
220227 // set partition.legacy-name to false, otherwise paimon will use toString for all types,
221228 // which will cause inconsistent partition value for the same binary value
222- options .set (CoreOptions . PARTITION_GENERATE_LEGCY_NAME , false );
229+ options .set (PARTITION_GENERATE_LEGACY_NAME_OPTION_KEY , Boolean . FALSE . toString () );
223230 }
224231
225232 private static void setFlussPropertyToPaimon (String key , String value , Options options ) {
0 commit comments