{"record":{"id":"d56ab8d8490db12a","repo":"apache/seatunnel","slug":"unsupported-right-expression-in-in-expected-a-par","errorCode":null,"errorMessage":"Unsupported right expression in IN: expected a parenthesized expression list","messagePattern":"Unsupported right expression in IN: expected a parenthesized expression list","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":321,"sourceCode":"        } else if (expression instanceof Parenthesis) {\n            Parenthesis parenthesis = (Parenthesis) expression;\n            return parseExpressionToPredicate(builder, rowType, parenthesis.getExpression());\n        } else if (expression instanceof InExpression) {\n            return handleInExpression(builder, rowType, (InExpression) expression);\n        }\n        throw new IllegalArgumentException(\n                \"Unsupported expression type: \" + expression.getClass().getSimpleName());\n    }\n\n    private static Predicate handleInExpression(\n            PredicateBuilder builder, RowType rowType, InExpression expr) {\n        Expression left = expr.getLeftExpression();\n        Column column = safeGetColumn(left);\n        int index = getColumnIndex(builder, column);\n\n        Expression right = expr.getRightExpression();\n        if (!(right instanceof ParenthesedExpressionList)) {\n            throw new IllegalArgumentException(\n                    \"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) {","sourceCodeStart":303,"sourceCodeEnd":339,"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#L303-L339","documentation":"handleInExpression requires the right-hand side of an IN clause to be a JSqlParser ParenthesedExpressionList (e.g. IN ('a','b')). Any other right-side form, most commonly a subquery, is rejected because the converter can only evaluate literal value lists.","triggerScenarios":"WHERE clause uses `col IN (SELECT x FROM t)` or a function/parameter expression on the right of IN instead of a parenthesized literal list.","commonSituations":"Subquery IN clauses generated by query builders or ORMs; templated SQL emitting IN without parentheses (e.g. IN ?, unquoted lists).","solutions":["Replace the subquery with an explicit literal list: col IN ('a','b','c').","Resolve subquery values beforehand and inline the literals.","Expand parameter placeholders into a parenthesized literal list before conversion."],"exampleFix":"// before: WHERE id IN (SELECT id FROM blacklist) | // after: WHERE id IN (1, 2, 3)","handlingStrategy":"validation","validationCode":"if (!(rightExpr instanceof ParenthesedExpressionList)) throw new IllegalArgumentException(\"IN must use a parenthesized literal list\");","typeGuard":"boolean isInList(Expression e) { return e instanceof ParenthesedExpressionList; }","tryCatchPattern":"try { pred = converter.convertSqlWhereToPaimonPredicate(where, rowType); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"IN\")) { /* fallback: no pushdown */ } }","preventionTips":["Never generate IN (subquery) for pushdown; inline resolved literals.","Ensure the right side of IN is always parenthesized.","Expand ?-parameter placeholders into a literal list before conversion."],"tags":["sql","paimon","predicate-pushdown","in-clause"],"backgroundTag":"invalid-argument-format","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"}