Skip to content

Conversation

@phillipleblanc
Copy link
Collaborator

…prepared

The insert_batch_prepared function was storing Date32/Date64 values as Unix
timestamps (e.g., 751248000), while the non-batch insert_batch function
(via InsertBuilder) correctly stores them as ISO-8601 date strings
(e.g., '1993-10-22').

When reading data back, the SQLite table provider expects date columns to
contain ISO-8601 formatted strings for proper parsing/casting back to
Arrow Date32 types. The Unix timestamp values failed to parse, resulting
in NULL/empty date values.

This change updates insert_batch_prepared to convert Date32/Date64 values
to ISO-8601 strings using time::OffsetDateTime, matching the behavior of
InsertBuilder::construct_insert_stmt.
@phillipleblanc phillipleblanc self-assigned this Dec 18, 2025
@phillipleblanc phillipleblanc added the bug Something isn't working label Dec 18, 2025
@phillipleblanc phillipleblanc merged commit c9363be into spiceai Dec 18, 2025
11 checks passed
@phillipleblanc phillipleblanc deleted the phillip/251217-fix-sqlite-decimal branch December 18, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants