{"record":{"id":"edb3e4904973cbc0","repo":"apache/seatunnel","slug":"unsupported-timestamp-value-type","errorCode":null,"errorMessage":"Unsupported timestamp value type: ","messagePattern":"Unsupported timestamp value type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/BaseTypeWriter.java","lineNumber":56,"sourceCode":"        return buffer;\n    }\n\n    protected boolean toBoolean(Object value) {\n        return value instanceof Boolean ? (Boolean) value : Boolean.parseBoolean(value.toString());\n    }\n\n    protected long convertToEpochMicro(Object value) {\n        if (value instanceof LocalDateTime) {\n            return ((LocalDateTime) value).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()\n                    * 1000;\n        } else if (value instanceof java.sql.Timestamp) {\n            return ((java.sql.Timestamp) value).getTime() * 1000;\n        } else if (value instanceof java.util.Date) {\n            return ((java.util.Date) value).getTime() * 1000;\n        } else if (value instanceof Number) {\n            return ((Number) value).longValue();\n        } else {\n            throw new IllegalArgumentException(\n                    \"Unsupported timestamp value type: \" + value.getClass());\n        }\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/BaseTypeWriter.java#L38-L61","documentation":"BaseTypeWriter.convertToEpochMicro converts a timestamp value to epoch microseconds for Arrow Timestamp vectors. If the value is neither LocalTime-compatible timestamp, java.sql.Timestamp, java.util.Date, nor Number, it throws IllegalArgumentException naming the actual Java class. It means the value written to a Lance timestamp column has an unexpected runtime type.","triggerScenarios":"A SeaTunnelRow field typed as timestamp carries an object other than LocalDateTime/java.sql.Timestamp/java.util.Date/Number when the writer serializes it to the Arrow vector.","commonSituations":"Upstream source (e.g. CDC or JDBC) delivered a custom temporal type or String into a TIMESTAMP field; a transform produced a String/BigDecimal timestamp; wrong field ordering caused values to land in the wrong column.","solutions":["Convert the value to java.time.LocalDateTime or java.sql.Timestamp before the Lance sink (e.g. in a transform or in the source's row converter).","If the value is a String, parse it with the correct pattern into LocalDateTime first.","Check the source connector's field type mapping so TIMESTAMP columns really deliver temporal types, not strings."],"exampleFix":"// before\nrow.setField(i, \"2024-01-01 10:00:00\"); // String into timestamp column\n// after\nrow.setField(i, java.sql.Timestamp.valueOf(\"2024-01-01 10:00:00\"));","handlingStrategy":"type-guard","validationCode":"if (!(value instanceof LocalDateTime || value instanceof java.sql.Timestamp || value instanceof java.util.Date || value instanceof Number)) throw new IllegalArgumentException(\"timestamp column got \" + value.getClass());","typeGuard":"static boolean isTimestampLike(Object v) { return v instanceof LocalDateTime || v instanceof java.sql.Timestamp || v instanceof java.util.Date || v instanceof Number; }","tryCatchPattern":"try { writer.write(row); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unsupported timestamp value type\")) { /* fix/convert row and re-run */ } throw e; }","preventionTips":["Ensure TIMESTAMP columns deliver LocalDateTime/Timestamp, never String.","Parse string timestamps at the source or in a transform.","Verify column ordering so temporal values don't land in wrong fields.","Add schema validation between source and sink stages."],"tags":["lance","arrow","timestamp","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}