{"record":{"id":"8650c48c069dc9bd","repo":"apache/seatunnel","slug":"common-06-8650c4","errorCode":"COMMON-06","errorMessage":"illegal argument 'BigQuery CDC sequence number must not be null' of 'sequence_number_column'","messagePattern":"illegal argument 'BigQuery CDC sequence number must not be null' of 'sequence_number_column'","errorType":"error_code","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/convert/BigQuerySerializer.java","lineNumber":117,"sourceCode":"                case UPDATE_BEFORE:\n                    jsonObject.put(CHANGE_TYPE, \"DELETE\");\n                    break;\n                default:\n                    throw CommonError.unsupportedOperation(\n                            element.getRowKind().toString(), \"Unsupported RowKind\");\n            }\n            if (sequenceFieldIndex != -1) {\n                jsonObject.put(\n                        SEQUENCE_NUM, encodeSequenceNumber(element.getField(sequenceFieldIndex)));\n            }\n        }\n\n        return jsonObject;\n    }\n\n    private String encodeSequenceNumber(Object value) {\n        if (value == null) {\n            throw invalidSequenceNumber(\"must not be null\");\n        }\n\n        if (value instanceof Byte\n                || value instanceof Short\n                || value instanceof Integer\n                || value instanceof Long) {\n            return encodeIntegralSequenceNumber(BigInteger.valueOf(((Number) value).longValue()));\n        }\n\n        if (value instanceof BigDecimal) {\n            try {\n                return encodeIntegralSequenceNumber(((BigDecimal) value).toBigIntegerExact());\n            } catch (ArithmeticException e) {\n                throw invalidSequenceNumber(\"must not contain a fractional value\");\n            }\n        }\n\n        if (value instanceof String) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/convert/BigQuerySerializer.java#L99-L135","documentation":"The BigQuery CDC serializer requires a sequence number to order CDC events; encodeSequenceNumber throws this invalid-argument error (COMMON-06) when the value of the configured sequence number column is null. A null sequence number makes the record's ordering in BigQuery undefined, so the connector rejects it.","triggerScenarios":"convert() processes a CDC row whose sequence_number_column value is null — the upstream source did not populate the sequence field, or the configured column name points at a column that is absent/null in the row.","commonSituations":"Misconfigured sequence_number_column name so it maps to a missing column; upstream CDC source (e.g. MySQL/Postgres CDC) emitting rows where the sequence/op position field is null; schema mismatch after table evolution.","solutions":["Verify the sequence_number_column option names a column that exists in every CDC row and is populated.","Check the upstream CDC source for events with null sequence metadata (e.g. schema-change or heartbeat events) and filter them.","Coerce nullable sequence columns upstream (e.g. NVL/CASE) so a real numeric value always reaches the sink.","If using CDC heartbeat/watermark events, drop them before this sink."],"exampleFix":"// before\n\"sequence_number_column\" = \"seq_no\"   // column not present in upstream rows\n// after: use the actual populated column\n\"sequence_number_column\" = \"binlog_pos\"","handlingStrategy":"validation","validationCode":"// before convert(), ensure the sequence value is present\nObject seq = row.getField(sequenceFieldIndex);\nif (seq == null) {\n    throw new IllegalArgumentException(\"row missing sequence number for CDC\");\n}","typeGuard":"static boolean hasSequenceNumber(SeaTunnelRow row, int idx) {\n    return idx >= 0 && idx < row.getArity() && row.getField(idx) != null;\n}","tryCatchPattern":"try {\n    sink.write(convert(row));\n} catch (SeaTunnelConnectorException e) {\n    if (e.getMessage().contains(\"sequence number must not be null\")) {\n        log.error(\"dropping CDC row with null sequence: {}\", row); // or route to DLQ\n        return;\n    }\n    throw e;\n}","preventionTips":["Confirm sequence_number_column matches a populated column in every CDC event","Filter out CDC heartbeat/schema-change events that lack sequence metadata","Add a NOT NULL/default upstream so sequence values are always present","Test with real upstream CDC snapshots plus incremental events before production"],"tags":["bigquery","cdc","null-value","sequence-number","validation"],"backgroundTag":"null-argument","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"}