private org.apache.iceberg.TableMetadata legacyTableMetadata(
      org.apache.iceberg.TableMetadata metadata, boolean changeStore) {
    PrimaryKeySpec keySpec = PrimaryKeySpec.noPrimaryKey();
    TableMeta tableMeta = tableMetadata().buildTableMeta();
    if (tableMeta.isSetKeySpec()) {
      PrimaryKeySpec.Builder keyBuilder = PrimaryKeySpec.builderFor(metadata.schema());
      tableMeta.getKeySpec().getFields().forEach(keyBuilder::addColumn);
      keySpec = keyBuilder.build();
    }
    TableIdentifier changeIdentifier =
        TableIdentifier.of(
            tableMetadata().getTableIdentifier().getDatabase(),
            tableMetadata().getTableIdentifier().getTableName()
                + InternalTableConstants.CHANGE_STORE_TABLE_NAME_SUFFIX);
    Map<String, String> properties = Maps.newHashMap(metadata.properties());
    if (!changeStore) {
      properties.putAll(
          TablePropertyUtil.baseStoreProperties(
              keySpec, changeIdentifier, TableFormat.MIXED_ICEBERG));
    } else {
      properties.putAll(
          TablePropertyUtil.changeStoreProperties(keySpec, TableFormat.MIXED_ICEBERG));
    }
    if (Maps.difference(properties, metadata.properties()).areEqual()) {
      return metadata;
    }
    return org.apache.iceberg.TableMetadata.buildFrom(metadata)
        .setProperties(properties)
        .discardChanges()
        .build();
  }
Table handler for mixed-iceberg format
amoro-ams/src/main/java/org/apache/amoro/server/table/internal/InternalMixedIcebergHandler.java