{"record":{"id":"2069f3653e96c92a","repo":"apache/flink","slug":"a-predicate-on-a-string-column-requires-a-floating","errorCode":null,"errorMessage":"A predicate on a STRING column requires a floating literal, i.e., Float or Double.","messagePattern":"A predicate on a STRING column requires a floating literal, i\\.e\\., Float or Double\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcFilters.java","lineNumber":445,"sourceCode":"                                        + \"literal, i.e., Byte, Short, Integer, or Long.\");\n                    }\n                case FLOAT:\n                    if (literal instanceof Float) {\n                        return new Double((Float) literal);\n                    } else if (literal instanceof Double) {\n                        return literal;\n                    } else if (literal instanceof BigDecimal) {\n                        return ((BigDecimal) literal).doubleValue();\n                    } else {\n                        throw new IllegalArgumentException(\n                                \"A predicate on a FLOAT column requires a floating \"\n                                        + \"literal, i.e., Float or Double.\");\n                    }\n                case STRING:\n                    if (literal instanceof String) {\n                        return literal;\n                    } else {\n                        throw new IllegalArgumentException(\n                                \"A predicate on a STRING column requires a floating \"\n                                        + \"literal, i.e., Float or Double.\");\n                    }\n                case BOOLEAN:\n                    if (literal instanceof Boolean) {\n                        return literal;\n                    } else {\n                        throw new IllegalArgumentException(\n                                \"A predicate on a BOOLEAN column requires a Boolean literal.\");\n                    }\n                case DATE:\n                    if (literal instanceof Date) {\n                        return literal;\n                    } else {\n                        throw new IllegalArgumentException(\n                                \"A predicate on a DATE column requires a java.sql.Date literal.\");\n                    }\n                case TIMESTAMP:","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcFilters.java#L427-L463","documentation":"Thrown when a predicate on an ORC STRING-typed column receives a literal that is not a java String. Note the message text itself is wrong — it is a copy-paste of the FLOAT branch saying 'requires a floating literal, i.e., Float or Double' — but the actual requirement in code is 'literal instanceof String'; trust the condition, not the message.","triggerScenarios":"An ORC predicate on a VARCHAR/CHAR/STRING column where the ValueLiteralExpression's Java value is not a String (e.g. an Integer or byte[] passed programmatically through OrcFilters).","commonSituations":"Programmatic OrcTableSource filter construction passing boxed numbers or byte arrays for string columns; hitting the misleading message and debugging in the wrong direction.","solutions":["Ensure the literal for a string column is a java.lang.String (String.valueOf(...) where needed).","Be aware the message is incorrect — interpret it as 'STRING column requires a String literal'.","Prefer the modern ORC filesystem connector for new code; its pushdown conversion is correct."],"exampleFix":"// before\nnew OrcFilters.Predicate(\"name\", PredicateLeaf.Type.STRING, 42)\n// after\nnew OrcFilters.Predicate(\"name\", PredicateLeaf.Type.STRING, \"42\")","handlingStrategy":"type-guard","validationCode":"Object lit = (value instanceof String) ? value : String.valueOf(value);","typeGuard":"static boolean isStringPushable(Object v) { return v instanceof String; }","tryCatchPattern":null,"preventionTips":["Remember the shipped message is a copy-paste error; the real rule is String literal for STRING columns.","Convert non-string values with String.valueOf before pushing down."],"tags":["flink","orc","predicate-pushdown","type-mismatch","string","misleading-message"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}