streaming-sql-engine 0.1.17__tar.gz → 0.1.19__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.
Files changed (86) hide show
  1. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/DEPLOYMENT.md +1 -0
  2. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/MANIFEST.in +1 -0
  3. {streaming_sql_engine-0.1.17/streaming_sql_engine.egg-info → streaming_sql_engine-0.1.19}/PKG-INFO +2 -4
  4. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/QUICK_DEPLOY.md +1 -0
  5. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/QUICK_FIX.md +1 -0
  6. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/__init__.py +1 -1
  7. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/HOW_PROTOCOL_DETECTION_WORKS.md +1 -0
  8. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/OPTIMIZER_AUTOMATED.md +1 -0
  9. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/SIMPLE_PROTOCOL_GUIDE.md +1 -0
  10. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/SIMPLE_SOURCE_FUNCTIONS.md +1 -0
  11. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHAT_IS_WHERE_TO_PARAMS.md +1 -0
  12. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHY_API_CONVERTER_NEEDED.md +1 -0
  13. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHY_MANUAL_PARSING.md +1 -0
  14. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHY_PROTOCOL_IN_SOURCES.md +1 -0
  15. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/pyproject.toml +66 -68
  16. streaming_sql_engine-0.1.19/requirements.txt +2 -0
  17. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/setup.py +81 -69
  18. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19/streaming_sql_engine.egg-info}/PKG-INFO +2 -4
  19. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/streaming_sql_engine.egg-info/SOURCES.txt +4 -0
  20. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/streaming_sql_engine.egg-info/requires.txt +1 -4
  21. streaming_sql_engine-0.1.19/test_polars_fixes.py +186 -0
  22. streaming_sql_engine-0.1.19/test_polars_schema_fix.py +147 -0
  23. streaming_sql_engine-0.1.17/requirements.txt +0 -7
  24. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/README.md +0 -0
  25. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/APACHE_DRILL_COMPARISON.md +0 -0
  26. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/API_JOIN_OPERATIONS.md +0 -0
  27. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/ARCHITECTURAL_RECOMMENDATION.md +0 -0
  28. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/ARCHITECTURE_DECISION.md +0 -0
  29. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/ARCHITECTURE_SYNCED.md +0 -0
  30. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/BEST_USE_CASES.md +0 -0
  31. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/BETTER_FILTER_APPROACH.md +0 -0
  32. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/CARTESIAN_PRODUCTS_CAUSES.md +0 -0
  33. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/CHANGES_SUMMARY.md +0 -0
  34. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/COMPREHENSIVE_ARTICLE.md +0 -0
  35. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/COMPREHENSIVE_DOCUMENTATION.md +0 -0
  36. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/DEVELOPER_GUIDE.md +0 -0
  37. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/DUCKDB_COMPARISON.md +0 -0
  38. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/ENGINE_OPTIONS_REFERENCE.md +0 -0
  39. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/FINAL_IMPLEMENTATION_RECOMMENDATIONS.md +0 -0
  40. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/FINAL_RECOMMENDATION.md +0 -0
  41. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/FIRST_MATCH_ONLY_WARNINGS.md +0 -0
  42. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/HANDLING_DUPLICATES_WITHOUT_CARTESIAN.md +0 -0
  43. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/HOW_TO_ADD_TO_PROJECT.md +0 -0
  44. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/INSTALLATION.md +0 -0
  45. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/JSONL_EXECUTOR_ANALYSIS.md +0 -0
  46. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/JSONL_EXECUTOR_REMOVED.md +0 -0
  47. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/LIBRARY_DOCUMENTATION.md +0 -0
  48. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/MEDIUM_ARTICLE.md +0 -0
  49. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/MIGRATION_GUIDE.md +0 -0
  50. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/MULTI_SOURCE_EXAMPLE_README.md +0 -0
  51. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/MYSQL_USAGE.md +0 -0
  52. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/OPTIMIZATIONS_BREAKDOWN.md +0 -0
  53. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/OPTIMIZATIONS_NOT_DATABASE_ONLY.md +0 -0
  54. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/OPTIMIZATIONS_VS_POLARS.md +0 -0
  55. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/PERFORMANCE.md +0 -0
  56. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/PERFORMANCE_COMPARISON.md +0 -0
  57. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/POLARS_AND_MMAP_GUIDE.md +0 -0
  58. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/PROTOCOL_AND_OPTIMIZATIONS_EXPLAINED.md +0 -0
  59. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/PROTOCOL_EXPLANATION.md +0 -0
  60. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/PUBLISHING.md +0 -0
  61. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/PYPI_CHECKLIST.md +0 -0
  62. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/QUICK_PUBLISH.md +0 -0
  63. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/QUICK_START.md +0 -0
  64. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/SOURCE_COMBINATIONS_GUIDE.md +0 -0
  65. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/TECHNICAL_DOCUMENTATION.md +0 -0
  66. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/USER_GUIDE.md +0 -0
  67. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHEN_POLARS_IS_USED.md +0 -0
  68. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHERE_POLARS_IS_USED.md +0 -0
  69. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/WHY_ORIGINAL_IS_FASTER.md +0 -0
  70. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/documentation/XML_MONGO_USE_CASE.md +0 -0
  71. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/engine.py +0 -0
  72. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/evaluator.py +0 -0
  73. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/executor.py +0 -0
  74. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/mmap_index.py +0 -0
  75. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/operators.py +0 -0
  76. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/operators_mmap.py +0 -0
  77. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/operators_polars.py +0 -0
  78. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/optimizer.py +0 -0
  79. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/parser.py +0 -0
  80. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/planner.py +0 -0
  81. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/polars_expression_translator.py +0 -0
  82. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/polars_operators.py +0 -0
  83. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/protocol_helpers.py +0 -0
  84. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/setup.cfg +0 -0
  85. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/streaming_sql_engine.egg-info/dependency_links.txt +0 -0
  86. {streaming_sql_engine-0.1.17 → streaming_sql_engine-0.1.19}/streaming_sql_engine.egg-info/top_level.txt +0 -0
@@ -153,3 +153,4 @@ Make it executable: `chmod +x deploy.sh`
153
153
  - **0.1.0** - Initial release
154
154
 
155
155
 
156
+
@@ -10,3 +10,4 @@ recursive-exclude * __pycache__
10
10
  recursive-exclude * *.pyc
11
11
 
12
12
 
13
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streaming-sql-engine
3
- Version: 0.1.17
3
+ Version: 0.1.19
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
@@ -24,8 +24,7 @@ Classifier: Programming Language :: Python :: 3.12
24
24
  Requires-Python: >=3.8
25
25
  Description-Content-Type: text/markdown
26
26
  Requires-Dist: sqlglot>=23.0.0
27
- Provides-Extra: polars
28
- Requires-Dist: polars>=0.19.0; extra == "polars"
27
+ Requires-Dist: polars>=0.19.0
29
28
  Provides-Extra: db
30
29
  Requires-Dist: psycopg2-binary>=2.9.0; extra == "db"
31
30
  Requires-Dist: pymysql>=1.0.0; extra == "db"
@@ -37,7 +36,6 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
36
  Requires-Dist: black>=23.0.0; extra == "dev"
38
37
  Requires-Dist: flake8>=6.0.0; extra == "dev"
39
38
  Provides-Extra: all
40
- Requires-Dist: polars>=0.19.0; extra == "all"
41
39
  Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
42
40
  Requires-Dist: pymysql>=1.0.0; extra == "all"
43
41
  Requires-Dist: DBUtils>=3.0.0; extra == "all"
@@ -81,3 +81,4 @@ Updated files:
81
81
  - Better error handling and debugging
82
82
 
83
83
 
84
+
@@ -52,3 +52,4 @@ python3 -c "import streaming_sql_engine; print(streaming_sql_engine.__file__)"
52
52
  - Fixed reconciliation script bug with `spryker_id_int` reference
53
53
 
54
54
 
55
+
@@ -27,5 +27,5 @@ try:
27
27
  except ImportError:
28
28
  __all__ = ["Engine"]
29
29
 
30
- __version__ = "0.1.17"
30
+ __version__ = "0.1.19"
31
31
 
@@ -304,3 +304,4 @@ register_file_source(engine, "categories", "data.csv")
304
304
 
305
305
  **That's the magic!** The helper functions do all the work for you.
306
306
 
307
+
@@ -186,3 +186,4 @@ for row in engine.query("SELECT users.name FROM users WHERE users.age > 30"):
186
186
 
187
187
  **Everything is automatic!** 🎉
188
188
 
189
+
@@ -270,3 +270,4 @@ engine.register("products", source)
270
270
 
271
271
  **Protocol support is now automatic!** 🎉
272
272
 
273
+
@@ -137,3 +137,4 @@ def file_source(filepath: str) -> Iterator[Dict]:
137
137
 
138
138
  **Key insight:** The engine's evaluator is already optimized. Don't duplicate its logic in file sources!
139
139
 
140
+
@@ -199,3 +199,4 @@ register_api_source(engine, "customers", API_BASE_URL, "customers")
199
199
  3. **Custom converter** only needed for special API formats
200
200
  4. **Your example** probably doesn't need it - try removing it!
201
201
 
202
+
@@ -227,3 +227,4 @@ register_api_source(engine, "customers", "http://api.com", "customers",
227
227
 
228
228
  **The default converter handles 90% of cases!** You only need custom converter for special APIs.
229
229
 
230
+
@@ -181,3 +181,4 @@ def file_source(dynamic_where=None, dynamic_columns=None):
181
181
  - File sources: Manual parsing (workaround) ⚠️
182
182
  - Or: Don't support filter pushdown for files (let engine filter)
183
183
 
184
+
@@ -261,3 +261,4 @@ for row in engine.query("SELECT users.name FROM users WHERE users.id > 100"):
261
261
 
262
262
  **The protocol is optional but enables huge performance improvements!**
263
263
 
264
+
@@ -1,68 +1,66 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "streaming-sql-engine"
7
- version = "0.1.17"
8
- description = "A lightweight SQL execution engine for streaming row-by-row queries with joins across multiple data sources"
9
- readme = "README.md"
10
- requires-python = ">=3.8"
11
- authors = [
12
- {name = "Theodore Pantazopoulo", email = "your.email@example.com"}
13
- ]
14
- keywords = ["sql", "streaming", "join", "database", "query", "engine", "etl", "data-integration"]
15
- classifiers = [
16
- "Development Status :: 3 - Alpha",
17
- "Intended Audience :: Developers",
18
- "Topic :: Software Development :: Libraries :: Python Modules",
19
- "Topic :: Database",
20
- "License :: OSI Approved :: MIT License",
21
- "Programming Language :: Python :: 3",
22
- "Programming Language :: Python :: 3.8",
23
- "Programming Language :: Python :: 3.9",
24
- "Programming Language :: Python :: 3.10",
25
- "Programming Language :: Python :: 3.11",
26
- "Programming Language :: Python :: 3.12",
27
- ]
28
- dependencies = [
29
- "sqlglot>=23.0.0",
30
- ]
31
-
32
- [project.optional-dependencies]
33
- polars = [
34
- "polars>=0.19.0",
35
- ]
36
- db = [
37
- "psycopg2-binary>=2.9.0",
38
- "pymysql>=1.0.0",
39
- "DBUtils>=3.0.0",
40
- "pymongo>=4.0.0",
41
- ]
42
- dev = [
43
- "pytest>=7.0.0",
44
- "pytest-cov>=4.0.0",
45
- "black>=23.0.0",
46
- "flake8>=6.0.0",
47
- ]
48
- all = [
49
- "polars>=0.19.0",
50
- "psycopg2-binary>=2.9.0",
51
- "pymysql>=1.0.0",
52
- "DBUtils>=3.0.0",
53
- "pymongo>=4.0.0",
54
- ]
55
-
56
- [project.urls]
57
- Homepage = "https://github.com/Ierofantis/streaming-sql-engine/tree/master"
58
- Repository = "https://github.com/Ierofantis/streaming-sql-engine/tree/master"
59
- Issues = "https://github.com/Ierofantis/streaming-sql-engine/issues"
60
- Documentation = "https://github.com/Ierofantis/streaming-sql-engine/tree/master#readme"
61
-
62
- [tool.setuptools]
63
- packages = ["streaming_sql_engine"]
64
- package-dir = {"streaming_sql_engine" = "."}
65
-
66
- [tool.setuptools.package-data]
67
- "*" = ["*.md", "*.txt"]
68
-
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "streaming-sql-engine"
7
+ version = "0.1.19"
8
+ description = "A lightweight SQL execution engine for streaming row-by-row queries with joins across multiple data sources"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ authors = [
12
+ {name = "Theodore Pantazopoulo", email = "your.email@example.com"}
13
+ ]
14
+ keywords = ["sql", "streaming", "join", "database", "query", "engine", "etl", "data-integration"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Topic :: Software Development :: Libraries :: Python Modules",
19
+ "Topic :: Database",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.8",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ ]
28
+ dependencies = [
29
+ "sqlglot>=23.0.0",
30
+ "polars>=0.19.0", # Required for default use_polars=True optimization
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ # Polars is now a required dependency (moved to dependencies above)
35
+ db = [
36
+ "psycopg2-binary>=2.9.0",
37
+ "pymysql>=1.0.0",
38
+ "DBUtils>=3.0.0",
39
+ "pymongo>=4.0.0",
40
+ ]
41
+ dev = [
42
+ "pytest>=7.0.0",
43
+ "pytest-cov>=4.0.0",
44
+ "black>=23.0.0",
45
+ "flake8>=6.0.0",
46
+ ]
47
+ all = [
48
+ "psycopg2-binary>=2.9.0",
49
+ "pymysql>=1.0.0",
50
+ "DBUtils>=3.0.0",
51
+ "pymongo>=4.0.0",
52
+ ]
53
+
54
+ [project.urls]
55
+ Homepage = "https://github.com/Ierofantis/streaming-sql-engine/tree/master"
56
+ Repository = "https://github.com/Ierofantis/streaming-sql-engine/tree/master"
57
+ Issues = "https://github.com/Ierofantis/streaming-sql-engine/issues"
58
+ Documentation = "https://github.com/Ierofantis/streaming-sql-engine/tree/master#readme"
59
+
60
+ [tool.setuptools]
61
+ packages = ["streaming_sql_engine"]
62
+ package-dir = {"streaming_sql_engine" = "."}
63
+
64
+ [tool.setuptools.package-data]
65
+ "*" = ["*.md", "*.txt"]
66
+
@@ -0,0 +1,2 @@
1
+ sqlglot>=23.0.0
2
+ polars>=0.19.0
@@ -1,69 +1,81 @@
1
- """
2
- Setup script for streaming-sql-engine
3
- """
4
-
5
- from setuptools import setup, find_packages
6
-
7
- with open("README.md", "r", encoding="utf-8") as fh:
8
- long_description = fh.read()
9
-
10
- with open("requirements.txt", "r", encoding="utf-8") as fh:
11
- requirements = [line.strip() for line in fh if line.strip() and not line.startswith("#")]
12
-
13
- setup(
14
- name="streaming-sql-engine",
15
- version="0.1.17",
16
- author="Theodore Pantazopoulo",
17
- author_email="your.email@example.com",
18
- description="A lightweight SQL execution engine for streaming row-by-row queries with joins across multiple data sources",
19
- long_description=long_description,
20
- long_description_content_type="text/markdown",
21
- url="https://github.com/Ierofantis/streaming-sql-engine/tree/master",
22
- # Package structure: files are in root directory
23
- packages=["streaming_sql_engine"],
24
- package_dir={"streaming_sql_engine": "."},
25
- py_modules=[
26
- "streaming_sql_engine.engine",
27
- "streaming_sql_engine.executor",
28
- "streaming_sql_engine.parser",
29
- "streaming_sql_engine.planner",
30
- "streaming_sql_engine.optimizer",
31
- "streaming_sql_engine.evaluator",
32
- "streaming_sql_engine.operators",
33
- "streaming_sql_engine.operators_polars",
34
- "streaming_sql_engine.operators_mmap",
35
- "streaming_sql_engine.mmap_index",
36
- "streaming_sql_engine.polars_expression_translator",
37
- "streaming_sql_engine.protocol_helpers",
38
- ],
39
- include_package_data=True,
40
- classifiers=[
41
- "Development Status :: 3 - Alpha",
42
- "Intended Audience :: Developers",
43
- "Topic :: Software Development :: Libraries :: Python Modules",
44
- "Topic :: Database",
45
- "Programming Language :: Python :: 3",
46
- "Programming Language :: Python :: 3.8",
47
- "Programming Language :: Python :: 3.9",
48
- "Programming Language :: Python :: 3.10",
49
- "Programming Language :: Python :: 3.11",
50
- "Programming Language :: Python :: 3.12",
51
- ],
52
- python_requires=">=3.8",
53
- install_requires=requirements,
54
- extras_require={
55
- "dev": [
56
- "pytest>=7.0.0",
57
- "pytest-cov>=4.0.0",
58
- "black>=23.0.0",
59
- "flake8>=6.0.0",
60
- ],
61
- },
62
- keywords="sql streaming join database query engine",
63
- project_urls={
64
- "Bug Reports": "https://github.com/Ierofantis/streaming-sql-engine/issues",
65
- "Source": "https://github.com/Ierofantis/streaming-sql-engine/tree/master",
66
- "Documentation": "https://github.com/Ierofantis/streaming-sql-engine/tree/master#readme",
67
- },
68
- )
69
-
1
+ """
2
+ Setup script for streaming-sql-engine
3
+ """
4
+
5
+ from setuptools import setup, find_packages
6
+
7
+ with open("README.md", "r", encoding="utf-8") as fh:
8
+ long_description = fh.read()
9
+
10
+ with open("requirements.txt", "r", encoding="utf-8") as fh:
11
+ requirements = [line.strip() for line in fh if line.strip() and not line.startswith("#")]
12
+
13
+ setup(
14
+ name="streaming-sql-engine",
15
+ version="0.1.19",
16
+ author="Theodore Pantazopoulo",
17
+ author_email="your.email@example.com",
18
+ description="A lightweight SQL execution engine for streaming row-by-row queries with joins across multiple data sources",
19
+ long_description=long_description,
20
+ long_description_content_type="text/markdown",
21
+ url="https://github.com/Ierofantis/streaming-sql-engine/tree/master",
22
+ # Package structure: files are in root directory
23
+ packages=["streaming_sql_engine"],
24
+ package_dir={"streaming_sql_engine": "."},
25
+ py_modules=[
26
+ "streaming_sql_engine.engine",
27
+ "streaming_sql_engine.executor",
28
+ "streaming_sql_engine.parser",
29
+ "streaming_sql_engine.planner",
30
+ "streaming_sql_engine.optimizer",
31
+ "streaming_sql_engine.evaluator",
32
+ "streaming_sql_engine.operators",
33
+ "streaming_sql_engine.operators_polars",
34
+ "streaming_sql_engine.operators_mmap",
35
+ "streaming_sql_engine.mmap_index",
36
+ "streaming_sql_engine.polars_expression_translator",
37
+ "streaming_sql_engine.protocol_helpers",
38
+ ],
39
+ include_package_data=True,
40
+ classifiers=[
41
+ "Development Status :: 3 - Alpha",
42
+ "Intended Audience :: Developers",
43
+ "Topic :: Software Development :: Libraries :: Python Modules",
44
+ "Topic :: Database",
45
+ "Programming Language :: Python :: 3",
46
+ "Programming Language :: Python :: 3.8",
47
+ "Programming Language :: Python :: 3.9",
48
+ "Programming Language :: Python :: 3.10",
49
+ "Programming Language :: Python :: 3.11",
50
+ "Programming Language :: Python :: 3.12",
51
+ ],
52
+ python_requires=">=3.8",
53
+ install_requires=requirements,
54
+ extras_require={
55
+ "db": [
56
+ "psycopg2-binary>=2.9.0",
57
+ "pymysql>=1.0.0",
58
+ "DBUtils>=3.0.0",
59
+ "pymongo>=4.0.0",
60
+ ],
61
+ "dev": [
62
+ "pytest>=7.0.0",
63
+ "pytest-cov>=4.0.0",
64
+ "black>=23.0.0",
65
+ "flake8>=6.0.0",
66
+ ],
67
+ "all": [
68
+ "psycopg2-binary>=2.9.0",
69
+ "pymysql>=1.0.0",
70
+ "DBUtils>=3.0.0",
71
+ "pymongo>=4.0.0",
72
+ ],
73
+ },
74
+ keywords="sql streaming join database query engine",
75
+ project_urls={
76
+ "Bug Reports": "https://github.com/Ierofantis/streaming-sql-engine/issues",
77
+ "Source": "https://github.com/Ierofantis/streaming-sql-engine/tree/master",
78
+ "Documentation": "https://github.com/Ierofantis/streaming-sql-engine/tree/master#readme",
79
+ },
80
+ )
81
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streaming-sql-engine
3
- Version: 0.1.17
3
+ Version: 0.1.19
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
@@ -24,8 +24,7 @@ Classifier: Programming Language :: Python :: 3.12
24
24
  Requires-Python: >=3.8
25
25
  Description-Content-Type: text/markdown
26
26
  Requires-Dist: sqlglot>=23.0.0
27
- Provides-Extra: polars
28
- Requires-Dist: polars>=0.19.0; extra == "polars"
27
+ Requires-Dist: polars>=0.19.0
29
28
  Provides-Extra: db
30
29
  Requires-Dist: psycopg2-binary>=2.9.0; extra == "db"
31
30
  Requires-Dist: pymysql>=1.0.0; extra == "db"
@@ -37,7 +36,6 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
36
  Requires-Dist: black>=23.0.0; extra == "dev"
38
37
  Requires-Dist: flake8>=6.0.0; extra == "dev"
39
38
  Provides-Extra: all
40
- Requires-Dist: polars>=0.19.0; extra == "all"
41
39
  Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
42
40
  Requires-Dist: pymysql>=1.0.0; extra == "all"
43
41
  Requires-Dist: DBUtils>=3.0.0; extra == "all"
@@ -20,6 +20,8 @@ protocol_helpers.py
20
20
  pyproject.toml
21
21
  requirements.txt
22
22
  setup.py
23
+ test_polars_fixes.py
24
+ test_polars_schema_fix.py
23
25
  ./DEPLOYMENT.md
24
26
  ./QUICK_DEPLOY.md
25
27
  ./QUICK_FIX.md
@@ -40,6 +42,8 @@ setup.py
40
42
  ./protocol_helpers.py
41
43
  ./requirements.txt
42
44
  ./setup.py
45
+ ./test_polars_fixes.py
46
+ ./test_polars_schema_fix.py
43
47
  documentation/APACHE_DRILL_COMPARISON.md
44
48
  documentation/API_JOIN_OPERATIONS.md
45
49
  documentation/ARCHITECTURAL_RECOMMENDATION.md
@@ -1,7 +1,7 @@
1
1
  sqlglot>=23.0.0
2
+ polars>=0.19.0
2
3
 
3
4
  [all]
4
- polars>=0.19.0
5
5
  psycopg2-binary>=2.9.0
6
6
  pymysql>=1.0.0
7
7
  DBUtils>=3.0.0
@@ -18,6 +18,3 @@ pytest>=7.0.0
18
18
  pytest-cov>=4.0.0
19
19
  black>=23.0.0
20
20
  flake8>=6.0.0
21
-
22
- [polars]
23
- polars>=0.19.0
@@ -0,0 +1,186 @@
1
+ """
2
+ Test script for Polars fixes with sample MongoDB and Spryker data.
3
+ Tests schema inference and duplicate column name handling.
4
+ """
5
+
6
+ import json
7
+ import tempfile
8
+ import os
9
+ from pathlib import Path
10
+ import sys
11
+
12
+ # Add parent directory to path
13
+ sys.path.insert(0, str(Path(__file__).parent))
14
+
15
+ from streaming_sql_engine import Engine
16
+
17
+ # Sample MongoDB data (with product_offer_reference to match Spryker)
18
+ mongo_data = [
19
+ {"sku": "96771", "price": "8.50", "list_price": None, "publish": False, "status": "D", "product_id": 34017149, "sf_sku": "SF-06349323", "merchant_reference": "MER304", "product_offer_reference": "MER304--.--96771--.--SF-06349323"},
20
+ {"sku": "96821", "price": "9.40", "list_price": None, "publish": False, "status": "D", "product_id": 34017404, "sf_sku": "SF-02477384", "merchant_reference": "MER304", "product_offer_reference": "MER304--.--96821--.--SF-02477384"},
21
+ {"sku": "8833", "price": "122.80", "list_price": "150.00", "publish": True, "status": "A", "product_id": 34018000, "sf_sku": "SF-14041047", "merchant_reference": "MER304", "product_offer_reference": "MER304--.--8833--.--SF-14041047"},
22
+ {"sku": "8848", "price": "99.50", "list_price": None, "publish": True, "status": "A", "product_id": 34018001, "sf_sku": "SF-14041057", "merchant_reference": "MER304", "product_offer_reference": "MER304--.--8848--.--SF-14041057"},
23
+ ]
24
+
25
+ # Sample Spryker data
26
+ spryker_data = [
27
+ {"id_product_offer": 152860217, "approval_status": "approved", "concrete_sku": "SF-14041047", "is_active": 1, "merchant_reference": "MER304", "merchant_sku": "8833", "product_offer_reference": "MER304--.--8833--.--SF-14041047", "sf_merchant_ean": "8021233128240", "sf_merchant_product_name": "Parlux Advance Light Gold 2200Watt", "sf_merchant_url": "https://hairbeautycorner.com/parlux-advance-light-gold-2200watt", "sf_shipping_lead_time": 0, "gross_price": "122.80", "reference": "MER304--.--8833--.--SF-14041047", "price_type": 1, "query": "reference"},
28
+ {"id_product_offer": 152860218, "approval_status": "approved", "concrete_sku": "SF-14041057", "is_active": 1, "merchant_reference": "MER304", "merchant_sku": "8848", "product_offer_reference": "MER304--.--8848--.--SF-14041057", "sf_merchant_ean": "8021233121012", "sf_merchant_product_name": "Parlux Superturbo High Power 2400W", "sf_merchant_url": "https://hairbeautycorner.com/parlux-superturbo-high-power", "sf_shipping_lead_time": 0, "gross_price": "99.50", "reference": "MER304--.--8848--.--SF-14041057", "price_type": 1, "query": "reference"},
29
+ {"id_product_offer": 152860219, "approval_status": "pending", "concrete_sku": "SF-06349323", "is_active": 0, "merchant_reference": "MER304", "merchant_sku": "96771", "product_offer_reference": "MER304--.--96771--.--SF-06349323", "sf_merchant_ean": "8021233129999", "sf_merchant_product_name": "Test Product 1", "sf_merchant_url": "https://example.com/product1", "sf_shipping_lead_time": 1, "gross_price": "8.50", "reference": "MER304--.--96771--.--SF-06349323", "price_type": 1, "query": "reference"},
30
+ ]
31
+
32
+ def create_jsonl_file(data, filename):
33
+ """Create a JSONL file with the given data."""
34
+ with open(filename, 'w', encoding='utf-8') as f:
35
+ for record in data:
36
+ f.write(json.dumps(record) + '\n')
37
+ print(f"[OK] Created {filename} with {len(data)} records")
38
+
39
+ def load_jsonl_generator(filename):
40
+ """Generator function to load JSONL file."""
41
+ with open(filename, 'r', encoding='utf-8') as f:
42
+ for line in f:
43
+ if line.strip():
44
+ yield json.loads(line)
45
+
46
+ def test_reconciliation_query():
47
+ """Test the reconciliation query with Polars enabled."""
48
+ print("=" * 70)
49
+ print("TESTING POLARS FIXES")
50
+ print("=" * 70)
51
+ print()
52
+
53
+ # Create temporary JSONL files
54
+ mongo_file = "test_mongo.jsonl"
55
+ spryker_file = "test_spryker.jsonl"
56
+
57
+ try:
58
+ create_jsonl_file(mongo_data, mongo_file)
59
+ create_jsonl_file(spryker_data, spryker_file)
60
+
61
+ # Initialize engine with Polars enabled (debug=False to avoid Unicode issues on Windows)
62
+ print("\n[1] Initializing engine with Polars enabled...")
63
+ engine = Engine(debug=False, use_polars=True)
64
+ print("[OK] Engine initialized")
65
+
66
+ # Register sources
67
+ print("\n[2] Registering data sources...")
68
+ engine.register("mongo", lambda: load_jsonl_generator(mongo_file), filename=mongo_file)
69
+ engine.register("spryker", lambda: load_jsonl_generator(spryker_file), filename=spryker_file)
70
+ print("[OK] Sources registered")
71
+
72
+ # Test query 1: Reference match (similar to reconciliation script)
73
+ print("\n[3] Testing reference match query...")
74
+ print("-" * 70)
75
+ query1 = """
76
+ SELECT
77
+ spryker.id_product_offer,
78
+ spryker.approval_status,
79
+ spryker.concrete_sku,
80
+ spryker.is_active,
81
+ spryker.merchant_reference,
82
+ spryker.merchant_sku,
83
+ spryker.product_offer_reference,
84
+ spryker.sf_merchant_ean,
85
+ spryker.sf_merchant_product_name,
86
+ spryker.sf_merchant_url,
87
+ spryker.sf_shipping_lead_time,
88
+ mongo.price,
89
+ mongo.list_price,
90
+ spryker.query AS query_type,
91
+ mongo.price AS mongo_price,
92
+ spryker.gross_price AS spryker_price,
93
+ mongo.status AS mongo_status,
94
+ spryker.is_active AS spryker_is_active
95
+ FROM spryker
96
+ JOIN mongo ON spryker.product_offer_reference = mongo.product_offer_reference
97
+ WHERE spryker.query = 'reference'
98
+ """
99
+
100
+ print("Query:")
101
+ print(query1.strip())
102
+ print()
103
+
104
+ # Debug: Check what data we have
105
+ print("\n[DEBUG] Checking data...")
106
+ print("Spryker product_offer_reference values:")
107
+ for record in spryker_data:
108
+ print(f" - {record.get('product_offer_reference')} (query: {record.get('query')})")
109
+ print("\nMongoDB product_offer_reference values:")
110
+ for record in mongo_data:
111
+ print(f" - {record.get('product_offer_reference')}")
112
+
113
+ results = []
114
+ try:
115
+ for row in engine.query(query1):
116
+ results.append(row)
117
+ print(f" Result: id={row.get('id_product_offer')}, mongo_price={row.get('mongo_price')}, spryker_price={row.get('spryker_price')}")
118
+ except Exception as e:
119
+ print(f" [ERROR] {e}")
120
+ import traceback
121
+ traceback.print_exc()
122
+ return False
123
+
124
+ print(f"\n[OK] Query 1 completed successfully: {len(results)} rows")
125
+
126
+ # Test query 2: Simple join without WHERE clause (to test join matching)
127
+ print("\n[4] Testing simple join query (no WHERE clause)...")
128
+ print("-" * 70)
129
+ query2 = """
130
+ SELECT
131
+ spryker.id_product_offer,
132
+ spryker.product_offer_reference,
133
+ mongo.price AS mongo_price,
134
+ spryker.gross_price AS spryker_price
135
+ FROM spryker
136
+ JOIN mongo ON spryker.product_offer_reference = mongo.product_offer_reference
137
+ """
138
+
139
+ print("Query:")
140
+ print(query2.strip())
141
+ print()
142
+
143
+ results2 = []
144
+ try:
145
+ for row in engine.query(query2):
146
+ results2.append(row)
147
+ print(f" Result {len(results2)}: id={row.get('id_product_offer')}, ref={row.get('product_offer_reference')}, mongo_price={row.get('mongo_price')}, spryker_price={row.get('spryker_price')}")
148
+ except Exception as e:
149
+ print(f" [ERROR] {e}")
150
+ import traceback
151
+ traceback.print_exc()
152
+ return False
153
+
154
+ print(f"\n[OK] Query 2 completed successfully: {len(results2)} rows")
155
+
156
+ # Verify we got matches
157
+ if len(results2) == 0:
158
+ print(" [WARNING] No matches found - this might indicate a join issue")
159
+ else:
160
+ print(" [SUCCESS] Join is working correctly!")
161
+
162
+ # Summary
163
+ print("\n" + "=" * 70)
164
+ print("TEST SUMMARY")
165
+ print("=" * 70)
166
+ print(f"[OK] Query 1 (with duplicate columns): {len(results)} rows")
167
+ print(f"[OK] Query 2 (simple join): {len(results2)} rows")
168
+ print("\n[OK] All tests passed! Polars fixes are working correctly.")
169
+ return True
170
+
171
+ except Exception as e:
172
+ print(f"\n[FAILED] TEST FAILED: {e}")
173
+ import traceback
174
+ traceback.print_exc()
175
+ return False
176
+ finally:
177
+ # Cleanup
178
+ for f in [mongo_file, spryker_file]:
179
+ if os.path.exists(f):
180
+ os.remove(f)
181
+ print(f" Cleaned up {f}")
182
+
183
+ if __name__ == "__main__":
184
+ success = test_reconciliation_query()
185
+ sys.exit(0 if success else 1)
186
+
@@ -0,0 +1,147 @@
1
+ """
2
+ Direct test of Polars schema inference and duplicate column fixes.
3
+ """
4
+
5
+ import json
6
+ import tempfile
7
+ import os
8
+ from pathlib import Path
9
+ import sys
10
+
11
+ sys.path.insert(0, str(Path(__file__).parent))
12
+
13
+ from streaming_sql_engine import Engine
14
+
15
+ def test_schema_inference_fix():
16
+ """Test that mixed types (string/numeric) don't cause schema inference errors."""
17
+ print("=" * 70)
18
+ print("TEST 1: Schema Inference Fix (Mixed Types)")
19
+ print("=" * 70)
20
+
21
+ # Create data with mixed types - some prices as strings, some as numbers
22
+ mixed_data = [
23
+ {"id": 1, "price": "14.95", "name": "Product 1"}, # String price
24
+ {"id": 2, "price": 15.50, "name": "Product 2"}, # Numeric price
25
+ {"id": 3, "price": "20.00", "name": "Product 3"}, # String price
26
+ {"id": 4, "price": 25.75, "name": "Product 4"}, # Numeric price
27
+ ]
28
+
29
+ # Create JSONL file
30
+ test_file = "test_mixed_types.jsonl"
31
+ with open(test_file, 'w') as f:
32
+ for record in mixed_data:
33
+ f.write(json.dumps(record) + '\n')
34
+
35
+ try:
36
+ engine = Engine(debug=False, use_polars=True)
37
+
38
+ def load_data():
39
+ with open(test_file, 'r') as f:
40
+ for line in f:
41
+ if line.strip():
42
+ yield json.loads(line)
43
+
44
+ engine.register("products", load_data, filename=test_file)
45
+
46
+ # Query that uses Polars join (will trigger schema inference)
47
+ query = """
48
+ SELECT p1.id, p1.price, p2.price AS other_price
49
+ FROM products p1
50
+ JOIN products p2 ON p1.id = p2.id
51
+ """
52
+
53
+ results = list(engine.query(query))
54
+ print(f"[OK] Query executed successfully: {len(results)} rows")
55
+ print(f"[OK] No schema inference errors!")
56
+ return True
57
+
58
+ except Exception as e:
59
+ if "could not append value" in str(e) or "infer_schema_length" in str(e):
60
+ print(f"[FAILED] Schema inference error still occurs: {e}")
61
+ return False
62
+ else:
63
+ print(f"[ERROR] Unexpected error: {e}")
64
+ import traceback
65
+ traceback.print_exc()
66
+ return False
67
+ finally:
68
+ if os.path.exists(test_file):
69
+ os.remove(test_file)
70
+
71
+ def test_duplicate_column_fix():
72
+ """Test that duplicate column selections don't cause errors."""
73
+ print("\n" + "=" * 70)
74
+ print("TEST 2: Duplicate Column Name Fix")
75
+ print("=" * 70)
76
+
77
+ # Create simple data
78
+ data = [
79
+ {"id": 1, "price": "10.00", "name": "Product 1"},
80
+ {"id": 2, "price": "20.00", "name": "Product 2"},
81
+ ]
82
+
83
+ test_file = "test_duplicate.jsonl"
84
+ with open(test_file, 'w') as f:
85
+ for record in data:
86
+ f.write(json.dumps(record) + '\n')
87
+
88
+ try:
89
+ engine = Engine(debug=False, use_polars=True)
90
+
91
+ def load_data():
92
+ with open(test_file, 'r') as f:
93
+ for line in f:
94
+ if line.strip():
95
+ yield json.loads(line)
96
+
97
+ engine.register("products", load_data, filename=test_file)
98
+
99
+ # Query with duplicate column selection (same column selected twice)
100
+ query = """
101
+ SELECT
102
+ products.price,
103
+ products.price AS price_alias,
104
+ products.id
105
+ FROM products
106
+ """
107
+
108
+ results = list(engine.query(query))
109
+ print(f"[OK] Query executed successfully: {len(results)} rows")
110
+ print(f"[OK] No duplicate column name errors!")
111
+
112
+ # Verify results have correct columns
113
+ if results:
114
+ row = results[0]
115
+ print(f"[OK] Result columns: {list(row.keys())}")
116
+ if 'price' in row and 'price_alias' in row:
117
+ print(f"[OK] Both 'price' and 'price_alias' present in results")
118
+ else:
119
+ print(f"[WARNING] Expected columns not found")
120
+
121
+ return True
122
+
123
+ except Exception as e:
124
+ if "duplicate output name" in str(e) or "duplicate column" in str(e):
125
+ print(f"[FAILED] Duplicate column error still occurs: {e}")
126
+ return False
127
+ else:
128
+ print(f"[ERROR] Unexpected error: {e}")
129
+ import traceback
130
+ traceback.print_exc()
131
+ return False
132
+ finally:
133
+ if os.path.exists(test_file):
134
+ os.remove(test_file)
135
+
136
+ if __name__ == "__main__":
137
+ test1 = test_schema_inference_fix()
138
+ test2 = test_duplicate_column_fix()
139
+
140
+ print("\n" + "=" * 70)
141
+ print("SUMMARY")
142
+ print("=" * 70)
143
+ print(f"Schema Inference Fix: {'PASSED' if test1 else 'FAILED'}")
144
+ print(f"Duplicate Column Fix: {'PASSED' if test2 else 'FAILED'}")
145
+
146
+ sys.exit(0 if (test1 and test2) else 1)
147
+
@@ -1,7 +0,0 @@
1
- sqlglot>=23.0.0
2
- psycopg2-binary>=2.9.0
3
- python-dotenv>=1.0.0
4
- pymysql>=1.0.0
5
- DBUtils>=3.0.0
6
- requests>=2.28.0
7
- polars>=0.19.0