4 ms·
Without speaking to the merits of Malloy Think of a sales orders table. Think of all the orders in there that should be considered "invalid" for some reason or
by kthejoker2 5y ago
Without speaking to the merits of Malloy
Think of a sales orders table. Think of all the orders in there that should be considered "invalid" for some reason or another.
It would be awesome to define some logic, one time, in one place, for "invalid orders" and then have end users be able to say "from invalid orders", "stores having no invalid orders", "customers with multiple invalid orders", "top 3 reasons orders are invalid" ...
And of course "valid orders" might just be defined as "not invalid orders"
Instead this is probably multiple views, CTEs, UDFs, and still some logic in the main query to handle NULLs or joins or whatnot.
Even little things like hierarchies - I don't want to have separate sprocs for salesByCountry, salesByRegion. salesByState,and then an umbrella dynamic sproc to figure out which one to call.
It's ironic because SQL is such a human friendly declarative language that it has such poor ability to create meaningful shorthand expressions.
I've written SQL for nearly 30 years, I love it, but natural language transpilers have shown me some of its limits as an expressive tool.
- edmundsauto 5y agoThis is the use case for a metric store. https://blog.transform.co/history-of-the-metrics-store/ https://blog.transform.co/history-of-the-metrics-store/ It's a separate system, which has downsides. As an upside, by being a component of your system, the integrations with monitoring, alerting, quality checks, and dashboards is usually pretty easy.
- kthejoker2 5y agoYeah I don't believe in a separate metrics store (or feature store - and I sell one!) It should all be in one SQL-like DSL with a natural language transpiler on top.
- edmundsauto 5y agoCan you recommend any good implementations of the ideal state? I worry that SQL is too much to learn, but natural language is way too ambiguous to map to anything resembling logic. (The best we can do, for natural logic -> executable logic is legislative code... And the ambiguity there is famous.)