{"record":{"id":"28685715a83d62f7","repo":"apache/iceberg","slug":"belowmin-has-no-value","errorCode":null,"errorMessage":"BelowMin has no value","messagePattern":"BelowMin has no value","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/expressions/Literals.java","lineNumber":209,"sourceCode":"    @Override\n    public Comparator<T> comparator() {\n      throw new UnsupportedOperationException(\"AboveMax has no comparator\");\n    }\n\n    @Override\n    public String toString() {\n      return \"aboveMax\";\n    }\n  }\n\n  static class BelowMin<T> implements Literal<T> {\n    private static final BelowMin INSTANCE = new BelowMin();\n\n    private BelowMin() {}\n\n    @Override\n    public T value() {\n      throw new UnsupportedOperationException(\"BelowMin has no value\");\n    }\n\n    @Override\n    public <X> Literal<X> to(Type type) {\n      throw new UnsupportedOperationException(\"Cannot change the type of BelowMin\");\n    }\n\n    @Override\n    public Comparator<T> comparator() {\n      throw new UnsupportedOperationException(\"BelowMin has no comparator\");\n    }\n\n    @Override\n    public String toString() {\n      return \"belowMin\";\n    }\n  }\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/expressions/Literals.java#L191-L227","documentation":"BelowMin is a sentinel literal representing values smaller than any representable value of the target type, produced when literal conversion underflows. Like AboveMax it is a marker only — there is no backing T value — so value() throws UnsupportedOperationException rather than returning null or a fabricated value.","triggerScenarios":"Calling value() on the object returned by Literals.belowMin(), usually obtained as the result of Literal.to(Type) when a literal underflows the target type during predicate binding.","commonSituations":"Generic code that iterates literals and reads .value() for logging, serialization, or custom evaluation without first excluding the belowMin sentinel.","solutions":["Check for the sentinel before reading the value: if (lit == Literals.belowMin()) handle specially","Branch on the bound predicate's evaluation semantics instead of extracting the raw value from sentinels","If the literal came from user input, validate the value fits the column type before converting"],"exampleFix":"// before\nObject v = lit.value();\n// after\nif (lit == Literals.belowMin()) {\n  // no value exists; treat comparison as always-true/false per operation\n} else {\n  Object v = lit.value();\n}","handlingStrategy":"type-guard","validationCode":"if (lit == Literals.belowMin()) { /* handle: no value exists */ }","typeGuard":"static boolean isSentinel(Literal<?> lit) { return lit == Literals.belowMin() || lit == Literals.aboveMax(); }","tryCatchPattern":"try { Object v = lit.value(); } catch (UnsupportedOperationException e) { /* sentinel: use always-true/false semantics */ }","preventionTips":["Never treat Literal.to() output as a normal value without a sentinel check","Validate user values against column ranges before literal creation","Favor bound predicates for evaluation logic"],"tags":["expressions","literals","sentinel","unsupported"],"backgroundTag":"unsupported-operation","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"}