Skip to content

Conversation

@phillipleblanc
Copy link
Collaborator

Previously we were decoding Decimals from SQLite as UTF8 - this was correct because in the spiceai project we were injecting a schema cast step before the datafusion execution kicked in. However, that should logically live in this project so that we can validate the datafusion logic based on the decimal types directly.

@phillipleblanc phillipleblanc self-assigned this Nov 28, 2025
@phillipleblanc phillipleblanc added the enhancement New feature or request label Nov 28, 2025
@phillipleblanc phillipleblanc enabled auto-merge (squash) November 28, 2025 06:38
@phillipleblanc phillipleblanc merged commit df8eeb1 into spiceai Nov 28, 2025
11 checks passed
@phillipleblanc phillipleblanc deleted the phillip/251128-properly-handle-decimal branch November 28, 2025 06:54
phillipleblanc added a commit that referenced this pull request Dec 17, 2025
phillipleblanc added a commit that referenced this pull request Dec 18, 2025
* Revert "Properly handle decoding decimals from SQLite using the decimal extension (#504)"

This reverts commit df8eeb1.

* Remove decimal test - its invalid

* Revert "Add roundtrip test and fix Decimal support"

This reverts commit b9e3c14.

* Use spiceai fork of sea-query

* fix(sqlite): store Date32/Date64 as ISO-8601 strings in insert_batch_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.

* Remove unneeded test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants