FeatureBaseDB / featurebase

A crazy fast analytical database, built on bitmaps. Perfect for ML applications. Learn more at: http://docs.featurebase.com/. Start a Docker instance: https://hub.docker.com/r/featurebasedb/featurebase
https://www.featurebase.com
Apache License 2.0
2.53k stars 231 forks source link

SQL test backfilling #2337

Closed seebs closed 1 year ago

seebs commented 1 year ago

This is actually two related sets of test cases in the parser/scanner stuff. (tickets 2073, 2074)

There's a couple of things in here which may want more careful attention. One is the previously-commented-out test case for a double inner join. It was commented out because stringizing the resulting data structure produced wildly different output, which broke the basic sanity checks. After studying this a bit, I've concluded that the code to "rewrite last source to nest next join on right side" logic was, in fact, precisely backwards -- we simply didn't want that code at all. Taking it out and expecting a data structure that makes sense also produces a data structure which stringizes back to the original query.

We add support for StringLit to know whether they came from blobs or not, so they can stringize to blobs again, so the round-trip testing works with them.

We add a test case that tests tuple assignment. I note that tuple assignment looks weird -- you have to use {} for the values, but () for the column names.

There's a number of still-unreached cases, but most of them are things where we check a token type with peek to decide to call a function, then that function asserts that the next token is that type. This shouldn't be capable of failing, but it's not a bad idea to have the extra checking there, I think?

seebs commented 1 year ago

Tagged Pat because the double-join logic wants someone who understands SQL to look at it more closely.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication