{"record":{"id":"344050f3fa24e069","repo":"apache/iceberg","slug":"unsupported-shredding-type-type","errorCode":null,"errorMessage":"Unsupported shredding type: <type>","messagePattern":"Unsupported shredding type: <type>","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/ParquetVariantUtil.java","lineNumber":499,"sourceCode":"          return shreddedPrimitive(\n              PrimitiveType.PrimitiveTypeName.INT64,\n              LogicalTypeAnnotation.timeType(false, LogicalTypeAnnotation.TimeUnit.MICROS));\n        case TIMESTAMPTZ_NANOS:\n          return shreddedPrimitive(\n              PrimitiveType.PrimitiveTypeName.INT64,\n              LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.NANOS));\n        case TIMESTAMPNTZ_NANOS:\n          return shreddedPrimitive(\n              PrimitiveType.PrimitiveTypeName.INT64,\n              LogicalTypeAnnotation.timestampType(false, LogicalTypeAnnotation.TimeUnit.NANOS));\n        case UUID:\n          return shreddedPrimitive(\n              PrimitiveType.PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY,\n              LogicalTypeAnnotation.uuidType(),\n              16);\n      }\n\n      throw new UnsupportedOperationException(\"Unsupported shredding type: \" + primitive.type());\n    }\n\n    private static GroupType objectFields(List<GroupType> fields) {\n      Types.GroupBuilder<GroupType> builder = Types.buildGroup(Type.Repetition.OPTIONAL);\n      for (GroupType field : fields) {\n        checkField(field);\n        builder.addField(field);\n      }\n\n      return builder.named(\"typed_value\");\n    }\n\n    private static void checkField(GroupType fieldType) {\n      Preconditions.checkArgument(\n          fieldType.isRepetition(Type.Repetition.REQUIRED),\n          \"Invalid field type repetition: %s should be REQUIRED\",\n          fieldType.getRepetition());\n    }","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/ParquetVariantUtil.java#L481-L517","documentation":"The variant shredding schema builder maps each Iceberg type to a Parquet primitive type (boolean, int, long, float, double, string, binary, date, timestamp, uuid as FIXED_LEN_BYTE_ARRAY(16), etc.). When the requested primitive type has no mapping, UnsupportedOperationException is thrown naming the type.","triggerScenarios":"Building a shredding schema (variantType/primitive) for an Iceberg Type whose PrimitiveType is not in the supported set — e.g. decimal, time, or nested types reaching the primitive branch.","commonSituations":"Shredding a variant column whose declared subtype is decimal or another not-yet-supported type; custom type extensions; spec/implementation gaps in newer type kinds.","solutions":["Restrict shredding subtypes to supported primitives (don't shred decimal/time yet)","Add a mapping case for the new type with an appropriate Parquet primitive (e.g. decimal via FIXED_LEN_BYTE_ARRAY)","Upgrade Iceberg if the type gained shredding support in a later version"],"exampleFix":"// before: shredding a decimal variant subtype\nTypes.DecimalType.of(10, 2)\n// after: leave decimal values unshredded in the variant value column\nTypes.NestedField.optional(id, \"value\", Types.StringType.get()) // or skip shredding spec for decimal","handlingStrategy":"validation","validationCode":"Set<Class<? extends Type.PrimitiveType>> supported = ImmutableSet.of(\n    BooleanType.class, IntegerType.class, LongType.class, FloatType.class,\n    DoubleType.class, StringType.class, BinaryType.class, DateType.class,\n    TimestampType.class, UUIDType.class);\nPreconditions.checkArgument(supported.contains(type.getClass()),\n    \"Type cannot be shredded as primitive: %s\", type);","typeGuard":"boolean isShreddablePrimitive(Type.PrimitiveType t) {\n  return !(t instanceof Types.DecimalType) && !(t instanceof Types.TimeType);\n}","tryCatchPattern":"try {\n  schema = variantShredding.primitive(type);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unsupported shredding type\")) {\n    // leave the values unshredded in the variant value column\n  } else throw e;\n}","preventionTips":["Only specify shredding specs for supported primitive subtypes","Leave decimal/time subtypes unshredded until supported","Test shredding schema builds for every type the table may contain"],"tags":["variant","shredding","unsupported-type","parquet"],"backgroundTag":"unsupported-enum-value","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"}