streaming-sql-engine 0.1.20__tar.gz → 0.1.22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/DEPLOYMENT.md +1 -0
- {streaming_sql_engine-0.1.20/streaming_sql_engine.egg-info → streaming_sql_engine-0.1.22}/PKG-INFO +1 -1
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/QUICK_DEPLOY.md +1 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/QUICK_FIX.md +1 -0
- streaming_sql_engine-0.1.22/RELEASE_READINESS_1.0.0.md +172 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/__init__.py +4 -4
- streaming_sql_engine-0.1.22/debug_tests.py +47 -0
- streaming_sql_engine-0.1.22/documentation/ENGINE_OPTIONS_REFERENCE.md +767 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/HOW_PROTOCOL_DETECTION_WORKS.md +1 -0
- streaming_sql_engine-0.1.22/documentation/MEDIUM_ARTICLE_SIMPLIFIED.md +692 -0
- streaming_sql_engine-0.1.22/documentation/MMAP_WITHOUT_POLARS_SLOW.md +283 -0
- streaming_sql_engine-0.1.22/documentation/MOST_STABLE_AND_PERFORMANT.md +508 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/OPTIMIZER_AUTOMATED.md +1 -0
- streaming_sql_engine-0.1.22/documentation/POLARS_VS_POLARS_MMAP.md +340 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/SIMPLE_PROTOCOL_GUIDE.md +1 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/SIMPLE_SOURCE_FUNCTIONS.md +1 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHAT_IS_WHERE_TO_PARAMS.md +1 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHY_API_CONVERTER_NEEDED.md +1 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHY_MANUAL_PARSING.md +1 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHY_PROTOCOL_IN_SOURCES.md +1 -0
- streaming_sql_engine-0.1.22/pre_release_test.py +336 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/pyproject.toml +1 -1
- streaming_sql_engine-0.1.22/quick_test.py +6 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/setup.py +1 -1
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22/streaming_sql_engine.egg-info}/PKG-INFO +1 -1
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/streaming_sql_engine.egg-info/SOURCES.txt +18 -1
- streaming_sql_engine-0.1.22/test_full_pipeline.py +19 -0
- streaming_sql_engine-0.1.22/test_where_debug.py +18 -0
- streaming_sql_engine-0.1.22/tests/test_engine_options.py +638 -0
- streaming_sql_engine-0.1.20/documentation/ENGINE_OPTIONS_REFERENCE.md +0 -264
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/MANIFEST.in +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/README.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/APACHE_DRILL_COMPARISON.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/API_JOIN_OPERATIONS.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/ARCHITECTURAL_RECOMMENDATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/ARCHITECTURE_DECISION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/ARCHITECTURE_SYNCED.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/BEST_USE_CASES.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/BETTER_FILTER_APPROACH.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/CARTESIAN_PRODUCTS_CAUSES.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/CHANGES_SUMMARY.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/COMPREHENSIVE_ARTICLE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/COMPREHENSIVE_DOCUMENTATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/DEVELOPER_GUIDE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/DUCKDB_COMPARISON.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/FINAL_IMPLEMENTATION_RECOMMENDATIONS.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/FINAL_RECOMMENDATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/FIRST_MATCH_ONLY_WARNINGS.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/HANDLING_DUPLICATES_WITHOUT_CARTESIAN.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/HOW_TO_ADD_TO_PROJECT.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/INSTALLATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/JSONL_EXECUTOR_ANALYSIS.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/JSONL_EXECUTOR_REMOVED.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/LIBRARY_DOCUMENTATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/MEDIUM_ARTICLE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/MIGRATION_GUIDE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/MULTI_SOURCE_EXAMPLE_README.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/MYSQL_USAGE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/OPTIMIZATIONS_BREAKDOWN.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/OPTIMIZATIONS_NOT_DATABASE_ONLY.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/OPTIMIZATIONS_VS_POLARS.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/PERFORMANCE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/PERFORMANCE_COMPARISON.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/POLARS_AND_MMAP_GUIDE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/PROTOCOL_AND_OPTIMIZATIONS_EXPLAINED.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/PROTOCOL_EXPLANATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/PUBLISHING.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/PYPI_CHECKLIST.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/QUICK_PUBLISH.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/QUICK_START.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/SOURCE_COMBINATIONS_GUIDE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/TECHNICAL_DOCUMENTATION.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/USER_GUIDE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHEN_POLARS_IS_USED.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHERE_POLARS_IS_USED.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/WHY_ORIGINAL_IS_FASTER.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/documentation/XML_MONGO_USE_CASE.md +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/engine.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/evaluator.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/executor.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/mmap_index.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/operators.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/operators_mmap.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/operators_polars.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/optimizer.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/parser.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/planner.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/polars_expression_translator.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/polars_operators.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/protocol_helpers.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/requirements.txt +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/setup.cfg +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/streaming_sql_engine.egg-info/dependency_links.txt +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/streaming_sql_engine.egg-info/requires.txt +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/streaming_sql_engine.egg-info/top_level.txt +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/test_polars_fixes.py +0 -0
- {streaming_sql_engine-0.1.20 → streaming_sql_engine-0.1.22}/test_polars_schema_fix.py +0 -0
{streaming_sql_engine-0.1.20/streaming_sql_engine.egg-info → streaming_sql_engine-0.1.22}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streaming-sql-engine
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.22
|
|
4
4
|
Summary: A lightweight SQL execution engine for streaming row-by-row queries with joins across multiple data sources
|
|
5
5
|
Home-page: https://github.com/Ierofantis/streaming-sql-engine/tree/master
|
|
6
6
|
Author: Theodore Pantazopoulo
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Release Readiness Report - Version 1.0.0
|
|
2
|
+
|
|
3
|
+
**Date**: 2025-12-14
|
|
4
|
+
**Status**: ✅ **READY FOR RELEASE**
|
|
5
|
+
|
|
6
|
+
## Test Results
|
|
7
|
+
|
|
8
|
+
### Pre-Release Test Suite
|
|
9
|
+
|
|
10
|
+
- **Total Tests**: 15
|
|
11
|
+
- **Passed**: 15 ✅
|
|
12
|
+
- **Failed**: 0
|
|
13
|
+
- **Status**: All tests passing
|
|
14
|
+
|
|
15
|
+
### Test Coverage
|
|
16
|
+
|
|
17
|
+
1. ✅ **Import Engine** - Engine imports successfully
|
|
18
|
+
2. ✅ **Engine initialization (default)** - Default `use_polars=False` works
|
|
19
|
+
3. ✅ **Engine initialization (use_polars=True)** - Polars can be enabled
|
|
20
|
+
4. ✅ **Engine initialization (use_polars=False)** - Polars can be disabled
|
|
21
|
+
5. ✅ **Register simple source** - Source registration works
|
|
22
|
+
6. ✅ **Simple SELECT query** - Basic SELECT works
|
|
23
|
+
7. ✅ **SELECT with WHERE clause** - WHERE filtering works
|
|
24
|
+
8. ✅ **INNER JOIN query** - INNER JOIN works correctly
|
|
25
|
+
9. ✅ **LEFT JOIN query** - LEFT JOIN works correctly (fixed)
|
|
26
|
+
10. ✅ **Column aliasing** - Column aliases work
|
|
27
|
+
11. ✅ **Table aliasing** - Table aliases work
|
|
28
|
+
12. ✅ **Multiple joins** - Multi-table joins work
|
|
29
|
+
13. ✅ **Empty result set** - Empty results handled correctly
|
|
30
|
+
14. ✅ **Version check** - Version accessible
|
|
31
|
+
15. ✅ **Polars optional** - Works without Polars
|
|
32
|
+
|
|
33
|
+
## Critical Fixes Applied
|
|
34
|
+
|
|
35
|
+
### 1. LEFT JOIN Support (Fixed)
|
|
36
|
+
|
|
37
|
+
- **Issue**: LEFT JOIN was being parsed as INNER JOIN
|
|
38
|
+
- **Root Cause**: sqlglot stores join type in `side` attribute, not `kind`
|
|
39
|
+
- **Fix**: Updated `planner.py` to check `join_expr.args.get("side")` instead of `join_expr.kind`
|
|
40
|
+
- **Status**: ✅ Fixed and tested
|
|
41
|
+
|
|
42
|
+
### 2. LEFT JOIN NULL Handling (Fixed)
|
|
43
|
+
|
|
44
|
+
- **Issue**: LEFT JOIN with no matches didn't add NULL values for right table columns
|
|
45
|
+
- **Root Cause**: Missing columns caused KeyError in projection
|
|
46
|
+
- **Fix**: Added NULL values for all right table columns when LEFT JOIN has no match
|
|
47
|
+
- **Status**: ✅ Fixed and tested
|
|
48
|
+
|
|
49
|
+
### 3. Default `use_polars` Changed (Intentional)
|
|
50
|
+
|
|
51
|
+
- **Change**: Default changed from `True` to `False`
|
|
52
|
+
- **Reason**: Python Lookup Join is faster for small-medium datasets
|
|
53
|
+
- **Status**: ✅ Documented and tested
|
|
54
|
+
|
|
55
|
+
## Code Quality Checks
|
|
56
|
+
|
|
57
|
+
### Linter Errors
|
|
58
|
+
|
|
59
|
+
- ✅ **No linter errors** found in `streaming_sql_engine` package
|
|
60
|
+
|
|
61
|
+
### Syntax Errors
|
|
62
|
+
|
|
63
|
+
- ✅ **No syntax errors** detected
|
|
64
|
+
|
|
65
|
+
### Import Errors
|
|
66
|
+
|
|
67
|
+
- ✅ **All imports** work correctly
|
|
68
|
+
|
|
69
|
+
## Version Consistency
|
|
70
|
+
|
|
71
|
+
- ✅ `pyproject.toml`: `0.1.21`
|
|
72
|
+
- ✅ `setup.py`: `0.1.21`
|
|
73
|
+
- ✅ `streaming_sql_engine/__init__.py`: `0.1.21`
|
|
74
|
+
|
|
75
|
+
**Note**: For 1.0.0 release, update all version numbers to `1.0.0`
|
|
76
|
+
|
|
77
|
+
## Documentation
|
|
78
|
+
|
|
79
|
+
### README
|
|
80
|
+
|
|
81
|
+
- ✅ Comprehensive README with examples
|
|
82
|
+
- ✅ Installation instructions
|
|
83
|
+
- ✅ Usage examples
|
|
84
|
+
|
|
85
|
+
### Examples
|
|
86
|
+
|
|
87
|
+
- ✅ Multiple example scripts in `examples/` directory
|
|
88
|
+
- ✅ Benchmark scripts
|
|
89
|
+
- ✅ Documentation files (MD format)
|
|
90
|
+
|
|
91
|
+
### API Documentation
|
|
92
|
+
|
|
93
|
+
- ✅ Docstrings in all public classes and methods
|
|
94
|
+
- ✅ Type hints where applicable
|
|
95
|
+
|
|
96
|
+
## Known Limitations
|
|
97
|
+
|
|
98
|
+
1. **RIGHT JOIN**: Not supported (only INNER and LEFT)
|
|
99
|
+
2. **FULL OUTER JOIN**: Not supported
|
|
100
|
+
3. **Complex WHERE clauses**: Some complex expressions may not be optimized
|
|
101
|
+
4. **Subqueries**: Not supported in current version
|
|
102
|
+
|
|
103
|
+
## Breaking Changes for 1.0.0
|
|
104
|
+
|
|
105
|
+
### Default Behavior Change
|
|
106
|
+
|
|
107
|
+
- **Before**: `Engine()` defaulted to `use_polars=True`
|
|
108
|
+
- **After**: `Engine()` defaults to `use_polars=False`
|
|
109
|
+
- **Impact**: Code that relied on Polars by default will now use Python joins
|
|
110
|
+
- **Migration**: Explicitly set `use_polars=True` if needed
|
|
111
|
+
|
|
112
|
+
## Recommended Pre-Release Checklist
|
|
113
|
+
|
|
114
|
+
### Version Update
|
|
115
|
+
|
|
116
|
+
- [ ] Update `pyproject.toml` version to `1.0.0`
|
|
117
|
+
- [ ] Update `setup.py` version to `1.0.0`
|
|
118
|
+
- [ ] Update `streaming_sql_engine/__init__.py` version to `1.0.0`
|
|
119
|
+
- [ ] Update `Development Status` classifier from `Alpha` to `Stable` (or `Beta`)
|
|
120
|
+
|
|
121
|
+
### Documentation
|
|
122
|
+
|
|
123
|
+
- [ ] Review and update CHANGELOG.md
|
|
124
|
+
- [ ] Update README.md with 1.0.0 release notes
|
|
125
|
+
- [ ] Verify all example scripts work
|
|
126
|
+
|
|
127
|
+
### Testing
|
|
128
|
+
|
|
129
|
+
- [x] Run pre-release test suite
|
|
130
|
+
- [x] Verify all tests pass
|
|
131
|
+
- [ ] Run example scripts manually
|
|
132
|
+
- [ ] Test with real-world data if possible
|
|
133
|
+
|
|
134
|
+
### Build & Distribution
|
|
135
|
+
|
|
136
|
+
- [ ] Clean build: `python -m build --clean`
|
|
137
|
+
- [ ] Verify wheel builds correctly
|
|
138
|
+
- [ ] Test installation: `pip install dist/streaming_sql_engine-1.0.0-py3-none-any.whl`
|
|
139
|
+
- [ ] Test import: `python -c "from streaming_sql_engine import Engine; print('OK')"`
|
|
140
|
+
|
|
141
|
+
### PyPI Upload
|
|
142
|
+
|
|
143
|
+
- [ ] Test upload to TestPyPI first: `twine upload --repository testpypi dist/*`
|
|
144
|
+
- [ ] Verify package on TestPyPI
|
|
145
|
+
- [ ] Upload to PyPI: `twine upload dist/*`
|
|
146
|
+
|
|
147
|
+
## Release Notes Summary
|
|
148
|
+
|
|
149
|
+
### Version 1.0.0 Highlights
|
|
150
|
+
|
|
151
|
+
1. **Stable API**: Core API is stable and well-tested
|
|
152
|
+
2. **LEFT JOIN Support**: Full LEFT JOIN support with NULL handling
|
|
153
|
+
3. **Performance**: Optimized defaults (Python joins for small datasets)
|
|
154
|
+
4. **Documentation**: Comprehensive examples and documentation
|
|
155
|
+
5. **Multiple Join Types**: INNER JOIN, LEFT JOIN, Merge Join, MMAP Join, Polars Join
|
|
156
|
+
6. **Optimizations**: Column pruning, filter pushdown, MMAP support
|
|
157
|
+
7. **Flexible Sources**: Support for databases, APIs, files, iterators
|
|
158
|
+
|
|
159
|
+
## Conclusion
|
|
160
|
+
|
|
161
|
+
✅ **The codebase is ready for 1.0.0 release.**
|
|
162
|
+
|
|
163
|
+
All critical functionality is working, tests pass, and the codebase is stable. The only remaining tasks are:
|
|
164
|
+
|
|
165
|
+
1. Update version numbers to 1.0.0
|
|
166
|
+
2. Update classifier to Stable/Beta
|
|
167
|
+
3. Build and upload to PyPI
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
**Recommendation**: Proceed with 1.0.0 release after updating version numbers.
|
|
172
|
+
|
|
@@ -16,16 +16,16 @@ try:
|
|
|
16
16
|
register_file_source,
|
|
17
17
|
register_api_source,
|
|
18
18
|
)
|
|
19
|
-
__all__ = [
|
|
20
|
-
|
|
19
|
+
__all__ = [
|
|
20
|
+
"Engine",
|
|
21
21
|
"add_protocol_support",
|
|
22
22
|
"wrap_simple_source",
|
|
23
23
|
"create_protocol_source",
|
|
24
24
|
"register_file_source",
|
|
25
25
|
"register_api_source",
|
|
26
|
-
]
|
|
26
|
+
]
|
|
27
27
|
except ImportError:
|
|
28
28
|
__all__ = ["Engine"]
|
|
29
29
|
|
|
30
|
-
__version__ = "0.1.
|
|
30
|
+
__version__ = "0.1.21"
|
|
31
31
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Debug failing tests"""
|
|
3
|
+
|
|
4
|
+
from streaming_sql_engine import Engine
|
|
5
|
+
|
|
6
|
+
# Test WHERE clause
|
|
7
|
+
print("=" * 60)
|
|
8
|
+
print("TEST 1: WHERE clause")
|
|
9
|
+
print("=" * 60)
|
|
10
|
+
engine = Engine()
|
|
11
|
+
def users_source():
|
|
12
|
+
return iter([
|
|
13
|
+
{"id": 1, "name": "Alice", "age": 30},
|
|
14
|
+
{"id": 2, "name": "Bob", "age": 25},
|
|
15
|
+
{"id": 3, "name": "Charlie", "age": 35},
|
|
16
|
+
])
|
|
17
|
+
engine.register("users", users_source)
|
|
18
|
+
results = list(engine.query("SELECT users.name FROM users WHERE users.age > 28"))
|
|
19
|
+
print(f"Results: {results}")
|
|
20
|
+
print(f"Count: {len(results)}")
|
|
21
|
+
print(f"Expected: 2 (Alice and Charlie)")
|
|
22
|
+
print()
|
|
23
|
+
|
|
24
|
+
# Test LEFT JOIN
|
|
25
|
+
print("=" * 60)
|
|
26
|
+
print("TEST 2: LEFT JOIN")
|
|
27
|
+
print("=" * 60)
|
|
28
|
+
engine2 = Engine()
|
|
29
|
+
def users_source2():
|
|
30
|
+
return iter([
|
|
31
|
+
{"id": 1, "name": "Alice"},
|
|
32
|
+
{"id": 2, "name": "Bob"},
|
|
33
|
+
{"id": 3, "name": "Charlie"},
|
|
34
|
+
])
|
|
35
|
+
def orders_source():
|
|
36
|
+
return iter([
|
|
37
|
+
{"id": 1, "user_id": 1, "product": "Book"},
|
|
38
|
+
])
|
|
39
|
+
engine2.register("users", users_source2)
|
|
40
|
+
engine2.register("orders", orders_source)
|
|
41
|
+
results2 = list(engine2.query(
|
|
42
|
+
"SELECT users.name, orders.product FROM users "
|
|
43
|
+
"LEFT JOIN orders ON users.id = orders.user_id"
|
|
44
|
+
))
|
|
45
|
+
print(f"Results: {results2}")
|
|
46
|
+
print(f"Count: {len(results2)}")
|
|
47
|
+
print(f"Expected: 3 (Alice, Bob, Charlie)")
|