fix(storage): handle MatrixOne aggregate and nullable parameter compatibility - #239
Conversation
Replace count-like SUM expressions with conditional COUNT and explicitly cast aggregate results before decoding them into Rust numeric types. Preserve nullable confidence averages and surface metrics decoding failures through warnings. Refs matrixorigin#238
|
Blocking: the new NULL-parameter workaround changes the existing empty-string contract for
Please derive the shape and bind value from |
|
Fixed in 84415b4. Both single and batch INSERT paths now derive the SQL shape and bind values from nullable_str() for session_id and superseded_by, preserving Some("") -> SQL NULL. Added raw-database regression coverage for both fields in single and batch inserts. Validation: Rust 1.85 cargo check/clippy passed; storage CRUD 26/26; session-scope API tests 5/5. |
aptend
left a comment
There was a problem hiding this comment.
Re-reviewed 84415b4. The NULL SQL-shape selection and bound values now consistently derive from nullable_str() for both single and batch INSERTs, and the new raw-database regression tests cover the empty-string contract. No remaining blocking issues.
Summary
Background
MatrixOne widened SUM(INT64/UINT64) to DECIMAL128(38,0), while affected Memoria queries still decoded those values as i64.
MatrixOne 4.2 also retains a prepared parameter NULL state across executions, so a non-NULL value following NULL can be persisted as NULL. The upstream fix is merged to MatrixOne main but is not present in the current 4.2 latest image.
Aggregate change: matrixorigin/matrixone@14c4e4d
Prepared parameter fix: matrixorigin/matrixone#26915
Validation
Validated against the current matrixorigin/matrixone:latest image with a 4 GB container:
Fixes #238