Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
caican committed Dec 24, 2024
1 parent 59c9456 commit ff12574
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

import static org.apache.gravitino.meta.AuditInfo.EMPTY;

import com.google.common.collect.Maps;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import lombok.ToString;
Expand Down Expand Up @@ -81,18 +79,15 @@ protected PaimonSchema internalBuild() {
PaimonSchema paimonSchema = new PaimonSchema();
paimonSchema.name = name;

Map<String, String> propertiesWithComment =
Maps.newHashMap(Optional.ofNullable(properties).orElse(new HashMap<>()));
if (comment != null) {
paimonSchema.comment = comment;
propertiesWithComment.put(PaimonSchemaPropertiesMetadata.COMMENT, comment);
} else if (properties != null) {
paimonSchema.comment = properties.get(PaimonSchemaPropertiesMetadata.COMMENT);
} else {
paimonSchema.comment = null;
}

paimonSchema.properties = propertiesWithComment;
paimonSchema.properties = properties;
paimonSchema.auditInfo = auditInfo;
return paimonSchema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.gravitino.spark.connector.integration.test.paimon;

import org.apache.gravitino.spark.connector.iceberg.GravitinoIcebergCatalogSpark35;
import org.apache.gravitino.spark.connector.paimon.GravitinoPaimonCatalogSpark35;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

Expand All @@ -28,6 +28,6 @@ public class SparkPaimonCatalogHiveBackendIT35 extends SparkPaimonCatalogHiveBac
void testCatalogClassName() {
String catalogClass =
getSparkSession().sparkContext().conf().get("spark.sql.catalog." + getCatalogName());
Assertions.assertEquals(GravitinoIcebergCatalogSpark35.class.getName(), catalogClass);
Assertions.assertEquals(GravitinoPaimonCatalogSpark35.class.getName(), catalogClass);
}
}

0 comments on commit ff12574

Please sign in to comment.