Minn Fong
06/26/2026, 6:58 PMRocky
06/26/2026, 6:59 PMNULL. In StarRocks, if a column is included in the columns header of a load, StarRocks will update it. If your data contains a NULL, it will overwrite the database value with NULL.
To avoid this while keeping a single broad schema:
* Use JSON Format: This is the most flexible. If you use format: json and partial_update: true, StarRocks will only update the fields actually present in the JSON object. If a field is omitted from the JSON for a specific row, the existing value in the database remains unchanged.
* Dynamic CSV Columns: If you use CSV, you would need to group rows by the exact set of columns they are updating and send them in separate requests (or separate blocks) with a columns header that matches only those columns. This is essentially the "bin-packing" you mentioned.
3. Comparison: Single Schema vs. Bin-Packing
Strategy | Best For | Pros | Cons
Single Broad Schema (via JSON) | Sparse updates across many columns. | Highest efficiency. Minimizes write amplification by updating each row once. | JSON parsing is slightly more CPU intensive than CSV.
Bin-Packing (Splitting by Co-occurrence) | Fixed-schema events (like CSV) that never overlap. | Good if events for the same PK never appear in different "bins." | If the same PK appears in multiple bins, you trigger multiple expensive "Applies" in Row Mode.
4. Recommendation for Your Architecture
Since you are updating ~20 columns and already have a 90s merge window:
1. Stick with Row Mode: Row Mode is optimized for cases where you update many columns in a single row or have small real-time batches.
2. Continue Merging in Memory: This is your strongest optimization. Reducing the "row count" sent to StarRocks is key.
3. Use JSON with Omitted Fields: Instead of sending NULL for columns that didn't change in your 90s window, simply omit those keys from the JSON object. This allows you to use a single "logical" schema while ensuring StarRocks only touches the columns that actually changed.
4. Leverage Merge Commit: Since you are in a distributed system, keep enable_merge_commit = true. This will batch the transactions on the StarRocks side, which reduces metadata overhead (IOPS) and helps prevent "too many versions" errors.
Summary: Do not split by co-occurrence (bin-pack) if it results in more rows per PK. Instead, merge as much as possible in memory and use a format (like JSON) that allows you to omit columns so they aren't overwritten with nulls.
References
• sql-reference/sql-functions/json-functions/json-query-and-processing-functions/json_set.md