The One-Line Migration
The simplest migration is changing your import:Step-by-Step Migration
1
Install chDB
2
Change the Import
3
Test Your Code
Run your existing code. Most operations work unchanged:
4
Handle Any Differences
A few operations behave differently. See Key Differences below.
What Works Unchanged
Data Loading
Filtering
Selection
GroupBy and Aggregation
Sorting
String Operations
DateTime Operations
I/O Operations
Key Differences
- Lazy Evaluation
DataStore operations are lazy - they don’t execute until results are needed.
pandas:
- Return Types
- No inplace Parameter
DataStore doesn’t support inplace=True. Always use the return value:
pandas:
- Comparing DataStores
pandas doesn’t recognize DataStore objects, so use to_pandas() for comparison:
- Row Order
DataStore may not preserve row order for file sources (like SQL databases). Use explicit sorting:
Migration Patterns
Pattern 1: Read-Analyze-Write
Pattern 2: DataFrame with pandas Operations
If you need pandas-specific features, convert at the end:Pattern 3: Mixed Workflow
Performance Comparison
DataStore is significantly faster for large datasets:
Benchmark on 10M rows
Troubleshooting Migration
Issue: Operation Not Working
Some pandas operations may not be supported. Check:- Is the operation in the compatibility list?
- Try converting to pandas first:
ds.to_df().operation()
Issue: Different Results
Enable debug logging to understand what’s happening:Issue: Slow Performance
Check your execution pattern:Issue: Type Mismatches
DataStore may infer types differently:Gradual Migration Strategy
Week 1: Test Compatibility
Week 2: Switch Simple Scripts
Start with scripts that:- Read large files
- Do filtering and aggregation
- Don’t use custom apply functions