TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

I wrote a SQL engine in Python

282 pointsby marsupialtail_2over 2 years ago

19 comments

sakrasover 2 years ago
I think the most interesting part of this project is the fault tolerance. I can’t say I’ve seen any other projects do this, but it seems reasonable to want checkpointing during a long computation.<p>Another thing I like is that conceptually it seems like it would be simple to switch the underlying query engine (right now it’s Polars) in the future. Seems like a pretty general distributed system.
评论 #34189737 未加载
评论 #34191635 未加载
评论 #34189679 未加载
int3over 2 years ago
I don&#x27;t have very much background in ML or distributed systems, so forgive my naive questions...<p>&gt; After all, most ML in industry today seems to be lightweight models applied to heavily engineered features<p>I assume &quot;lightweight models&quot; are those that don&#x27;t have too many parameters, and &quot;heavily engineered features&quot; mean that the data fed into the model has undergone significant pre-processing via potentially complicated UDFs -- hence the motivation for the project. Is that right?<p>&gt; Quokka is an open-source push-based vectorized query engine ... it is meant to be much more performant than blocking-shuffle based alternatives like SparkSQL<p>Does anyone have pointers to what push-based vs blocking-shuffle engines are? Any good papers?<p>&gt; It should work on local machine no problem (and should be a lot faster than Pandas!)<p>So I understand why Quokka is faster than Spark, but I&#x27;m a bit uncertain as to why the author is also making a comparison with Pandas on a single machine. Is it because the streaming pipeline design means that Quokka can better take advantage of multiple cores?
评论 #34194029 未加载
totalhackover 2 years ago
Sorry if I missed it -- Are there plans to offer a way to query this in actual sql? I believe SingleStore is MySQL compatible for example which I think is a nice feature. Basically I want to be able to interact with this much like I&#x27;d interact with another database I&#x27;m using or perhaps with a sqlalchemy core integration (which both SingleStore and Snowflake have).
评论 #34191853 未加载
theLiminatorover 2 years ago
Can you explain how this might differ from something like <a href="https:&#x2F;&#x2F;github.com&#x2F;apache&#x2F;arrow-ballista">https:&#x2F;&#x2F;github.com&#x2F;apache&#x2F;arrow-ballista</a><p>I&#x27;ve seen several variants of &quot;next-gen&quot; spark, but nowhere have I really seen the different tradeoffs&#x2F;advantages&#x2F;disadvantages between them.
评论 #34190260 未加载
joocerover 2 years ago
Thanks for sharing.<p>I have a SQL Engine in Python too (<a href="https:&#x2F;&#x2F;github.com&#x2F;mabel-dev&#x2F;opteryx">https:&#x2F;&#x2F;github.com&#x2F;mabel-dev&#x2F;opteryx</a>). I focused my initial effort on supporting SQL statements and making the usage feel like a database - that probably reflects the problem I had in front of me when I set out - only handling handfuls of gigabytes in a batch environment for ETLs with a group of new-to-data-engineering engineers. Have recently started looking more at real-time performance, such as distributing work. Am interesting in how you&#x27;ve approached.
评论 #34221412 未加载
cpardover 2 years ago
Trino can be fault tolerant but you have to explicitly enable fault tolerant execution.<p>It might be worth running your benchmarks against Trino with fault tolerant execution mode enabled. Check the documentation here: <a href="https:&#x2F;&#x2F;trino.io&#x2F;docs&#x2F;current&#x2F;admin&#x2F;fault-tolerant-execution.html" rel="nofollow">https:&#x2F;&#x2F;trino.io&#x2F;docs&#x2F;current&#x2F;admin&#x2F;fault-tolerant-execution...</a><p>Adding fault tolerant to execution to Trino was a big and complicated project for anyone interested in more details check here: <a href="https:&#x2F;&#x2F;trino.io&#x2F;blog&#x2F;2022&#x2F;05&#x2F;05&#x2F;tardigrade-launch.html" rel="nofollow">https:&#x2F;&#x2F;trino.io&#x2F;blog&#x2F;2022&#x2F;05&#x2F;05&#x2F;tardigrade-launch.html</a>
评论 #34192659 未加载
nivekkevinover 2 years ago
One significant disadvantage of PySpark is its reliance on py4j to serialize and deserialize objects between Java and Python when using Python UDFs. This constant overhead can become burdensome as data volume increases in such an exchange. However, I am glad to see efforts to create a data pipeline framework using Python and Ray.<p>~One suggestion, a Scala&#x2F;Java Spark run of those benchmarks should be a valid baseline to compare against as well instead of PySpark.~ Ah it&#x27;s SparkSQL so the execution probably wouldn&#x27;t have much of py4j involvement, except for the collect.
评论 #34192959 未加载
评论 #34192786 未加载
PontifexMinimusover 2 years ago
Funnily enough I&#x27;m currently writing a NoSQL database in Python.
评论 #34190901 未加载
评论 #34190840 未加载
einpoklumover 2 years ago
&gt; A library to parse and optimize SQL,<p>That&#x27;s like saying &quot;a library to parse and optimize computer programs&quot;, except probably even harder, since a compiler and runtime library can&#x27;t make any assumptions about the programs they need to make run, so they&#x27;re limited in the potential of utilizing all that context information.<p>Countless person-years have been spent on this and it&#x27;s still a very active fields of research and engineering.<p>&gt; 2x SparkSQL performance<p>Ah, ok, so it can be slow. Never mind then, carry on :-P
评论 #34190848 未加载
评论 #34190658 未加载
eatonphilover 2 years ago
The core of it is Rust:<p>&gt; Very fast kernels for SQL primitives like joins, filtering and aggregations. Quokka uses Polars to implement these. (I sponsor Polars on Github and you should too.) I am also exploring DuckDB, but I have found Polars to be faster so far.
评论 #34193303 未加载
评论 #34191855 未加载
评论 #34192063 未加载
akdor1154over 2 years ago
I&#x27;m interested in this just for the use case of &#x27;a sql frontend for polars&#x27; - I wonder if just that part could be used independently?
评论 #34194663 未加载
评论 #34192666 未加载
polskibusover 2 years ago
I have previously used Dask to handle larger data sets, and that made me wonder - how does Quokka compare to Dask?
samsquireover 2 years ago
I wrote a toy distributed SQL, cypher graph, dynamodb style and document storage Python database but it&#x27;s more for experimentation than serious use. It&#x27;s not ready for use it&#x27;s more a show of how little code you can use to write a database.<p><a href="https:&#x2F;&#x2F;GitHub.com&#x2F;samsquire&#x2F;hash-db">https:&#x2F;&#x2F;GitHub.com&#x2F;samsquire&#x2F;hash-db</a>
评论 #34192574 未加载
评论 #34193218 未加载
cogsboxover 2 years ago
I like good sql projects like this. I use duckdb for almost everything.
brunobowdenover 2 years ago
Python interpreter in SQL - the reverse of what was done - would&#x27;ve been really impressive. Terrible idea of course but impressive nonetheless.
评论 #34190582 未加载
zitterbewegungover 2 years ago
Have you tested this with Jepsen?
评论 #34190899 未加载
imiricover 2 years ago
I haven&#x27;t looked into this in detail, and it seems like a fine project at a glance, but this caught my attention from the introduction:<p>&gt; When I set out, I had several objectives:<p>&gt; Easy to install and run, especially for distributed deployments.<p>&gt; [...]<p>&gt; The first two objectives strongly scream Python as the language of choice for Quokka.<p>Python is probably one of the last languages I&#x27;d consider if ease of deployment is a priority. Packaging has historically been a mess, and deploying standalone binaries across platforms is a pain. State of the art solutions are 3rd party and involve bundling the intepreter for each platform. It&#x27;s been a few years since I last used it for anything serious, but I believe this is still the case.<p>Whereas something like Go actually makes this infinitely easier, for both the developer and the user. One native Go command builds a standalone binary for each platform. It couldn&#x27;t be simpler.<p>The other objective of supporting Python UDFs necessarily ties you to Python. And since this is solving a data science problem, it makes sense for it to be written in Python.
评论 #34191864 未加载
评论 #34191883 未加载
ris58hover 2 years ago
Isn&#x27;t there should be Show HN in the title?
评论 #34193826 未加载
throwaway290over 2 years ago
&gt; Having lost all the money I made from my startup on shitcoins and the stock market, I returned to my PhD program to build a better distributed query engine, Quokka<p>Casual README slip of the year...
评论 #34194096 未加载
评论 #34194104 未加载