{"record":{"id":"f98c90839a867596","repo":"apache/seatunnel","slug":"failed-to-convert-value-in-in-clause-rawval","errorCode":null,"errorMessage":"Failed to convert value in IN clause: ${rawVal}","messagePattern":"Failed to convert value in IN clause: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/converter/SqlToPaimonPredicateConverter.java","lineNumber":340,"sourceCode":"                    \"Unsupported right expression in IN: expected a parenthesized expression list\");\n        }\n\n        ParenthesedExpressionList list = (ParenthesedExpressionList) right;\n        List<Expression> expressions = list.getExpressions();\n        if (expressions.isEmpty()) {\n            throw new IllegalArgumentException(\"Empty value list in IN clause is not allowed\");\n        }\n\n        List<Object> values = new ArrayList<>(expressions.size());\n        for (Expression expression : expressions) {\n            Object rawVal = getJSQLParserDataTypeValue(expression);\n            if (rawVal == null) {\n                throw new IllegalArgumentException(\"Null value found in IN clause values\");\n            }\n            Object convertedVal =\n                    convertValueByPaimonDataType(rowType, column.getColumnName(), rawVal);\n            if (convertedVal == null) {\n                throw new IllegalArgumentException(\n                        \"Failed to convert value in IN clause: \" + rawVal);\n            }\n            values.add(convertedVal);\n        }\n\n        return expr.isNot() ? builder.notIn(index, values) : builder.in(index, values);\n    }\n\n    private static Column safeGetColumn(Expression expr) {\n        if (!(expr instanceof Column)) {\n            throw new IllegalArgumentException(\n                    \"Expected Column expression, but got: \" + expr.getClass().getSimpleName());\n        }\n        return (Column) expr;\n    }\n\n    private static Object convertValueByPaimonDataType(\n            RowType rowType, String columnName, Object jsqlParserDataTypeValue) {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/converter/SqlToPaimonPredicateConverter.java#L322-L358","documentation":"After getJSQLParserDataTypeValue returns a raw value, convertValueByPaimonDataType must map it to the column's Paimon/SeaTunnel type. If the conversion returns null (type mismatch or unparseable literal), the converter throws this error naming the offending raw value rather than emitting a corrupt predicate.","triggerScenarios":"An IN-list literal cannot be converted for the column's declared type, e.g. `int_col IN (1, 'abc', 3)` or a wrongly formatted date/timestamp literal.","commonSituations":"Quoted/unquoted literal mismatches with column types; locale/format issues in date literals; schema type changes after the query was written.","solutions":["Quote string values and leave numbers unquoted so the literal type matches the column type.","Fix date/timestamp literals to the format the converter's parse helpers expect.","Verify the column's type in the Paimon schema matches what the query assumes."],"exampleFix":"// before: WHERE int_col IN (1, '2', 3) | // after: WHERE int_col IN (1, 2, 3)","handlingStrategy":"validation","validationCode":"for (Object v : values) { switch (columnType) { case INT: case BIGINT: require v instanceof Long; case VARCHAR: require v instanceof String; case DATE: case TIMESTAMP: validate parseable format; } }","typeGuard":null,"tryCatchPattern":"try { pred = converter.convertSqlWhereToPaimonPredicate(where, rowType); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Failed to convert value\")) log.error(\"Bad literal for column type\", e); throw e; }","preventionTips":["Match literal quoting to column types (quote strings, not numbers).","Keep date/timestamp literals in the converter's expected format.","Re-verify IN literals after any schema type change."],"tags":["sql","paimon","type-conversion","in-clause"],"backgroundTag":"type-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}