{"record":{"id":"034b9c57e3de994d","repo":"alibaba/DataX","slug":"col-not-found","errorCode":null,"errorMessage":"Col {} not found","messagePattern":"Col (.+?) not found","errorType":"exception","errorClass":"ColumnNotFoundException","httpStatus":null,"severity":"error","filePath":"hbase11xsqlwriter/src/main/java/com/alibaba/datax/plugin/writer/hbase11xsqlwriter/ThinClientPTable.java","lineNumber":106,"sourceCode":"  @Override\n  public List<PColumnFamily> getColumnFamilies() {\n    throw new UnsupportedOperationException(\"Not implement\");\n  }\n\n  @Override\n  public PColumnFamily getColumnFamily(byte[] bytes) throws ColumnFamilyNotFoundException {\n    throw new UnsupportedOperationException(\"Not implement\");\n  }\n\n  @Override\n  public PColumnFamily getColumnFamily(String s) throws ColumnFamilyNotFoundException {\n    throw new UnsupportedOperationException(\"Not implement\");\n  }\n\n  @Override\n  public PColumn getColumnForColumnName(String colname) throws ColumnNotFoundException, AmbiguousColumnException {\n    if (!colMap.containsKey(colname)) {\n      throw new ColumnNotFoundException(\"Col \" + colname + \" not found\");\n    }\n    return colMap.get(colname);\n  }\n\n  @Override\n  public PColumn getColumnForColumnQualifier(byte[] bytes, byte[] bytes1)\n      throws ColumnNotFoundException, AmbiguousColumnException {\n    throw new UnsupportedOperationException(\"Not implement\");\n  }\n\n  @Override\n  public PColumn getPKColumn(String s) throws ColumnNotFoundException {\n    throw new UnsupportedOperationException(\"Not implement\");\n  }\n\n  @Override\n  public PRow newRow(KeyValueBuilder keyValueBuilder, long l, ImmutableBytesWritable immutableBytesWritable, boolean b,\n      byte[]... bytes) {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/hbase11xsqlwriter/src/main/java/com/alibaba/datax/plugin/writer/hbase11xsqlwriter/ThinClientPTable.java#L88-L124","documentation":"ColumnNotFoundException (a Phoenix SQLException subtype) from ThinClientPTable.getColumnForColumnName: the requested column name is not in colMap, the map of columns previously loaded from the server's table metadata. It means the writer is looking up a column that the Phoenix table does not advertise under that exact name.","triggerScenarios":"Any code path that resolves columns by name against ThinClientPTable (e.g. value conversion in hbase11xsqlwriter) with a column name not present in the loaded schema — unquoted identifiers are uppercased by Phoenix, so lowercase names often miss; schema drift after columns were dropped/renamed also triggers it.","commonSituations":"Job config uses lowercase column names against a case-sensitive table created with quoted lowercase identifiers (or vice versa); column dropped or renamed server-side; column family-qualified name mismatch; trailing whitespace in column names.","solutions":["Compare the job's column list with the server schema (`!describe <table>` in sqlline) and match the exact case.","Quote identifiers in DDL/job config consistently so Phoenix's default identifier uppercasing does not bite.","Re-load/restart the writer after schema changes so stale metadata caches are refreshed."],"exampleFix":"-- before\nCREATE TABLE \"events\" (id BIGINT PRIMARY KEY, payload VARCHAR)\n-- job uses: payload  -> works; job uses: PAYLOAD -> Col not found\n-- after\nquote consistently or use uppercase identifiers:\nCREATE TABLE EVENTS (ID BIGINT PRIMARY KEY, PAYLOAD VARCHAR)","handlingStrategy":"validation","validationCode":"Set<String> schemaCols = new HashSet<>();\nfor (PColumn c : table.getColumns()) schemaCols.add(c.getName().getString());\nfor (String col : jobConfigColumns) {\n    if (!schemaCols.contains(col)) throw new IllegalArgumentException(\"Unknown column: \" + col);\n}","typeGuard":"boolean columnExists(ThinClientPTable t, String name) {\n    try { t.getColumnForColumnName(name); return true; }\n    catch (ColumnNotFoundException e) { return false; }\n}","tryCatchPattern":"try {\n    PColumn c = table.getColumnForColumnName(name);\n} catch (ColumnNotFoundException e) {\n    // schema drift: refresh table metadata, fix case, or fail with column list diff\n}","preventionTips":["Diff job column lists against the live schema (sqlline `!describe`) as a pre-flight step.","Standardize identifier casing (prefer unquoted uppercase) in both DDL and jobs.","After any DDL change, restart/reload writer metadata before running jobs."],"tags":["phoenix","hbase","datax","schema","column-not-found"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}