Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.8.x] Core: Adjust Jackson settings to handle large metadata json (#12224) #12330

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonFactoryBuilder;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;

class RESTObjectMapper {
private static final JsonFactory FACTORY = new JsonFactory();
private static final JsonFactory FACTORY =
new JsonFactoryBuilder()
.configure(JsonFactory.Feature.INTERN_FIELD_NAMES, false)
.configure(JsonFactory.Feature.FAIL_ON_SYMBOL_HASH_OVERFLOW, false)
.build();
private static final ObjectMapper MAPPER = new ObjectMapper(FACTORY);
private static volatile boolean isInitialized = false;

Expand Down
7 changes: 6 additions & 1 deletion core/src/main/java/org/apache/iceberg/util/JsonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iceberg.util;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonFactoryBuilder;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand All @@ -43,7 +44,11 @@ public class JsonUtil {

private JsonUtil() {}

private static final JsonFactory FACTORY = new JsonFactory();
private static final JsonFactory FACTORY =
new JsonFactoryBuilder()
.configure(JsonFactory.Feature.INTERN_FIELD_NAMES, false)
.configure(JsonFactory.Feature.FAIL_ON_SYMBOL_HASH_OVERFLOW, false)
.build();
private static final ObjectMapper MAPPER = new ObjectMapper(FACTORY);

public static JsonFactory factory() {
Expand Down
9 changes: 6 additions & 3 deletions mr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@ project(':iceberg-mr') {
exclude group: 'org.apache.hive', module: 'hive-storage-api'
}

testImplementation libs.calcite.core
testImplementation libs.calcite.druid
testImplementation(libs.calcite.core) {
exclude group: 'org.apache.calcite.avatica', module: 'avatica'
}
testImplementation(libs.calcite.druid) {
exclude group: 'org.apache.calcite.avatica', module: 'avatica'
}

testImplementation project(path: ':iceberg-data', configuration: 'testArtifacts')
testImplementation project(path: ':iceberg-api', configuration: 'testArtifacts')
testImplementation project(path: ':iceberg-core', configuration: 'testArtifacts')
testImplementation project(path: ':iceberg-hive-metastore', configuration: 'testArtifacts')

testImplementation libs.avro.avro
testImplementation libs.calcite.core
testImplementation libs.kryo.shaded
testImplementation platform(libs.jackson.bom)
testImplementation libs.jackson.annotations
Expand Down
Loading