{"record":{"id":"30c4a3637984445d","repo":"apache/iceberg","slug":"unsupported-type-long","errorCode":null,"errorMessage":"Unsupported type: long","messagePattern":"Unsupported type: long","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java","lineNumber":61,"sourceCode":"          column.close();\n        } catch (Exception e) {\n          throw new RuntimeException(e);\n        }\n      }\n    }\n    vector.close();\n  }\n\n  public boolean getBoolean(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: boolean\");\n  }\n\n  public int getInt(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: int\");\n  }\n\n  public long getLong(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: long\");\n  }\n\n  public float getFloat(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: float\");\n  }\n\n  public double getDouble(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: double\");\n  }\n\n  public byte[] getBinary(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: binary\");\n  }\n\n  public DecimalT getDecimal(int rowId, int precision, int scale) {\n    throw new UnsupportedOperationException(\"Unsupported type: decimal\");\n  }\n","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java#L43-L79","documentation":"The base ArrowVectorAccessor.getLong(int) is an unimplemented stub that always throws. Concrete long-backed accessors must override it; calling the base means no long accessor was wired for this vector. Callers in the codebase (timestamp/bigint/time/rowId materialization helpers) rely on subclasses providing it.","triggerScenarios":"Reading a long/bigint/timestamp column through an accessor that does not override getLong — e.g. a generic accessor built without a LongVector mapping, or base-class instantiation in custom code.","commonSituations":"Custom vectorized extensions missing the long accessor; new Arrow vector types not mapped in the accessor factory; timestamp columns routed through an accessor lacking getLong.","solutions":["Route long-backed vectors to an accessor subclass overriding getLong.","Override getLong in your concrete accessor: return vector.get(rowId).","Use the accessor factory keyed on the vector's Field type rather than instantiating the base class."],"exampleFix":"// before\nlong v = baseAccessor.getLong(rowId); // throws\n// after\nclass LongAccessor extends ArrowVectorAccessor<BigIntVector> {\n  @Override public long getLong(int rowId) { return vector.get(rowId); }\n}","handlingStrategy":"type-guard","validationCode":"if (!(accessor instanceof LongAccessor)) { /* use non-vectorized path */ }","typeGuard":"static boolean supportsLong(ArrowVectorAccessor<?> a) {\n  return a.getClass() != ArrowVectorAccessor.class;\n}","tryCatchPattern":"try {\n  long v = accessor.getLong(rowId);\n} catch (UnsupportedOperationException e) {\n  if (\"Unsupported type: long\".equals(e.getMessage())) { fallbackRead(rowId); } else { throw e; }\n}","preventionTips":["Ensure timestamp/bigint/time columns map to a BigIntVector-backed accessor.","Override getLong in custom subclasses.","Cover the toTimestampVector/toBigIntVector paths with accessor-level tests."],"tags":["arrow","unsupported-type","vectorized-read","long","timestamp"],"backgroundTag":"method-not-implemented","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"}