{"record":{"id":"40f1da4fe44b3333","repo":"apache/seatunnel","slug":"bigquery-cdc-sequence-number-each-section-must-con","errorCode":null,"errorMessage":"BigQuery CDC sequence number each section must contain at most 16 characters","messagePattern":"BigQuery CDC sequence number each section must contain at most 16 characters","errorType":"exception","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/convert/BigQuerySerializer.java","lineNumber":172,"sourceCode":"                        value.getClass().getSimpleName()));\n    }\n\n    private String encodeIntegralSequenceNumber(BigInteger number) {\n        if (number.signum() < 0) {\n            throw invalidSequenceNumber(\"must not be negative\");\n        }\n        if (number.bitLength() > 64) {\n            throw invalidSequenceNumber(\"must not exceed the unsigned 64-bit range\");\n        }\n        return number.toString(16).toUpperCase(Locale.ROOT);\n    }\n\n    private void validateSequenceSection(String section) {\n        if (section.isEmpty()) {\n            throw invalidSequenceNumber(\"must not contain an empty section\");\n        }\n        if (section.length() > 16) {\n            throw invalidSequenceNumber(\"each section must contain at most 16 characters\");\n        }\n        for (int i = 0; i < section.length(); i++) {\n            char character = section.charAt(i);\n            boolean isHexDigit =\n                    (character >= '0' && character <= '9')\n                            || (character >= 'A' && character <= 'F')\n                            || (character >= 'a' && character <= 'f');\n            if (!isHexDigit) {\n                throw invalidSequenceNumber(\"must contain only hexadecimal characters\");\n            }\n        }\n    }\n\n    private SeaTunnelRuntimeException invalidSequenceNumber(String reason) {\n        return CommonError.illegalArgument(\n                String.format(\"BigQuery CDC sequence number %s\", reason),\n                BigQuerySinkOptions.SEQUENCE_NUMBER_COLUMN.key());\n    }","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/convert/BigQuerySerializer.java#L154-L190","documentation":"Every section of a String-encoded CDC sequence number may hold at most 16 hexadecimal characters (64 bits per section); longer sections cannot map to the unsigned-64-per-slot encoding and are rejected by validateSequenceSection.","triggerScenarios":"A '/'-separated section with length > 16 is passed to encodeSequenceNumber, e.g. a 32-character hex string without a '/' separating it into two 16-char sections.","commonSituations":"A 128-bit (32-hex-char) value pasted as a single section instead of being split; uppercase/padded hex from another system exceeding 16 chars; pre-encoded values produced by a different CDC tool with different sectioning rules.","solutions":["Split long hex strings into <=16-character sections, e.g. \"aabb...\" (32 chars) becomes first16 + \"/\" + last16.","Truncate or hash the value to 64 bits if only one 64-bit slot is intended.","Regenerate the sequence number from the source's raw integral fields instead of importing a foreign pre-encoded hex string.","Validate inputs with regex ^[0-9A-Fa-f]{1,16}(/[0-9A-Fa-f]{1,16}){0,3}$ before the job runs."],"exampleFix":"// before\nString seq = \"0123456789ABCDEF0123456789ABCDEF\"; // 32 chars in one section\n// after\nString seq = \"0123456789ABCDEF/0123456789ABCDEF\"; // split into 16-char sections","handlingStrategy":"validation","validationCode":"boolean ok = seq.matches(\"^[0-9A-Fa-f]{1,16}(/[0-9A-Fa-f]{1,16}){0,3}$\"); if (!ok) { throw new IllegalArgumentException(\"sequence number sections must be 1-16 hex chars, max 4 sections: \" + seq); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Split hex strings longer than 16 chars into 16-char sections.","Validate the format with a regex at pipeline-configuration time.","Document the sectioning rule for any producer of these values."],"tags":["bigquery","cdc","validation","format"],"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"}