apache/seatunnel · error · IllegalArgumentException
column does not exist.
Error message
column ${fieldName} does not exist. What it means
convertSqlSelectToPaimonProjectionIndex maps the SELECT's column list to indices of the Paimon table's field names; when a requested column (after stripping backticks) is not found in fieldNames it throws IllegalArgumentException('column X does not exist.').
Solutions
- Verify the column exists in the Paimon table schema (list fields) and correct the SELECT column list
- Match exact case and remove unsupported quoting characters
- Sync the Paimon table schema if the column was recently added upstream (schema evolution)
- Rebuild the projection list from the actual table fields instead of hardcoding
Example fix
// before String sql = "SELECT User_Name, age FROM t"; // table has field userName // after String sql = "SELECT userName, age FROM t";
Defensive patterns
Strategy: validation
Validate before calling
for (String col : requestedColumns) { String f = col.replace("`", ""); if (!Arrays.asList(fieldNames).contains(f)) throw new IllegalArgumentException("column " + f + " does not exist"); } Type guard
boolean columnsExist(List<String> cols, String[] fieldNames) { return cols.stream().map(c -> c.replace("`", "")).allMatch(c -> Arrays.asList(fieldNames).contains(c)); } Try / catch
try { int[] idx = converter.convertSqlSelectToPaimonProjectionIndex(query, fieldNames); } catch (IllegalArgumentException e) { if (e.getMessage().endsWith("does not exist.")) { /* fix projection list */ } throw e; } Prevention
- Derive projection lists from the live Paimon table schema
- Keep source and sink schemas in sync to avoid drift
- Watch for case sensitivity and backtick differences in column names
When it happens
Trigger: A projection SELECT references a column name that does not match any field of the Paimon table schema — wrong name, wrong case, missing quoting, or referencing a column added upstream but not yet synced to Paimon.
Common situations: Schema drift between source and Paimon table; typos in projection lists; case-sensitivity differences (CamelCase vs snake_case); backtick handling mismatches; querying a renamed column.
Related errors
- The column named [ ] is not exists
- Empty value list in IN clause is not allowed
- Error parsing SQL.
- Expected Column expression, but got
- Failed to convert value in IN clause
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/fdcce9f9b6c38d86.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/converter/SqlToPaimonPredicateConverter.java:132
List<String> columnNames = new ArrayList<>();
for (SelectItem selectItem : selectItems) {
if (selectItem.getExpression() instanceof AllColumns) {
return null;
} else {
String columnName = ((Column) selectItem.getExpression()).getColumnName();
columnNames.add(columnName);
}
}
projectionIndex =
columnNames.stream()
.mapToInt(
columnName -> {
String fieldName = columnName.replace("`", "");
int index = Arrays.asList(fieldNames).indexOf(fieldName);
if (index == -1) {
throw new IllegalArgumentException(
"column " + fieldName + " does not exist.");
}
return index;
})
.toArray();
return projectionIndex;
}
public static Predicate convertSqlWhereToPaimonPredicate(
RowType rowType, PlainSelect plainSelect) {
Expression whereExpression = plainSelect.getWhere();
if (Objects.isNull(whereExpression)) {
return null;
}
PredicateBuilder builder = new PredicateBuilder(rowType);
return parseExpressionToPredicate(builder, rowType, whereExpression);
}View on GitHub (pinned to cf67b549a7)