{"record":{"id":"03c5572d9acc8944","repo":"apache/iceberg","slug":"couldn-t-set-arrow-properties-which-may-impact-re","errorCode":null,"errorMessage":"Couldn't set Arrow properties, which may impact read performance","messagePattern":"Couldn't set Arrow properties, which may impact read performance","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/VectorizedSparkParquetReaders.java","lineNumber":49,"sourceCode":"import org.apache.iceberg.spark.SparkUtil;\nimport org.apache.parquet.schema.MessageType;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class VectorizedSparkParquetReaders {\n\n  private static final Logger LOG = LoggerFactory.getLogger(VectorizedSparkParquetReaders.class);\n  private static final String ENABLE_UNSAFE_MEMORY_ACCESS = \"arrow.enable_unsafe_memory_access\";\n  private static final String ENABLE_UNSAFE_MEMORY_ACCESS_ENV = \"ARROW_ENABLE_UNSAFE_MEMORY_ACCESS\";\n  private static final String ENABLE_NULL_CHECK_FOR_GET = \"arrow.enable_null_check_for_get\";\n  private static final String ENABLE_NULL_CHECK_FOR_GET_ENV = \"ARROW_ENABLE_NULL_CHECK_FOR_GET\";\n\n  static {\n    try {\n      enableUnsafeMemoryAccess();\n      disableNullCheckForGet();\n    } catch (Exception e) {\n      LOG.warn(\"Couldn't set Arrow properties, which may impact read performance\", e);\n    }\n  }\n\n  private VectorizedSparkParquetReaders() {}\n\n  public static ColumnarBatchReader buildReader(\n      Schema expectedSchema,\n      MessageType fileSchema,\n      Map<Integer, ?> idToConstant,\n      BufferAllocator bufferAllocator) {\n    return (ColumnarBatchReader)\n        TypeWithSchemaVisitor.visit(\n            expectedSchema.asStruct(),\n            fileSchema,\n            new ReaderBuilder(\n                expectedSchema,\n                fileSchema,\n                NullCheckingForGet.NULL_CHECKING_ENABLED,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/VectorizedSparkParquetReaders.java#L31-L67","documentation":"The VectorizedSparkParquetReaders class sets Arrow allocator properties (unsafe memory access, disabled null checks on get) in a static initializer to speed up vectorized reads. If setting them fails, it logs this warning and falls back to slower safe behavior rather than failing reads.","triggerScenarios":"Static class initialization where the Arrow reflection-based unsafe-access configuration throws (e.g. missing sun.misc.Unsafe access, restricted JDK modules, or Arrow version mismatch).","commonSituations":"Running on JDKs with --illegal-access denied / strong encapsulation without --add-opens, hardened JVMs, or shaded/conflicting Arrow versions on the classpath.","solutions":["Verify Arrow runtime version matches the one Iceberg was built against","Add JVM flags enabling unsafe access (e.g. --add-opens java.base/java.nio=ALL-UNNAMED)","Check the chained exception in the log to identify the failing property call"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// check JVM unsafe access: boolean ok = io.netty.util.internal.PlatformDependent.hasUnsafe();","typeGuard":null,"tryCatchPattern":"try { Class.forName(\"org.apache.iceberg.spark.data.vectorized.VectorizedSparkParquetReaders\"); } catch (Throwable t) { /* falls back to non-vectorized path; add --add-opens flags */ }","preventionTips":["Run on a JDK where sun.misc.Unsafe is available","Pin the Arrow version matching the Iceberg Spark runtime","Add --add-opens java.base/java.nio=ALL-UNNAMED to driver/executor JVM options"],"tags":["spark","arrow","vectorized-read","performance"],"backgroundTag":"feature-not-enabled","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}