Live data from Hacker News

Text-to-SQL is dead, long live text-to-SQL

exasol.com

11–20 of 52 posts

Re: Text-to-SQL is dead, long live text-to-SQL

#11
Text-to-SQL is effectively pissing in the wind when we start looking at business value. The trouble is that it works just enough to be dangerous. It is a very interesting idea and can easily consume the resources of a technical team ~indefinitely. One obvious sign we are chasing shiny here is the German-to-SQL example. This is fun, but no one would actually pay for it.

I would classify Text-to-SQL as a Schedule I rabbit hole. It has some serious effects, but it otherwise has no acceptable level of value-add in most reasonable enterprises.

Re: Text-to-SQL is dead, long live text-to-SQL

#12
What is the human need to bash SQL at all costs? At its core, such a simple syntax, yet its so powerful at aggregating/manipulating tabular data and the like. Instead we’d rather declaratively say what we want in a more verbose/disjointed way… fascinating

Re: Text-to-SQL is dead, long live text-to-SQL

#13

What is the human need to bash SQL at all costs? At its core, such a simple syntax, yet its so powerful at aggregating/manipulating tabular data and the like. Instead we’d rather declaratively say what we want in a more verbose/disjointed way… fascinating

I'll give one reason of many: Its fixed pipeline model doesn't match how humans think about data transformation.

Re: Text-to-SQL is dead, long live text-to-SQL

#14
post #11

Text-to-SQL is effectively pissing in the wind when we start looking at business value. The trouble is that it works just enough to be dangerous. It is a very interesting idea and can easily consume the resources of a technical team ~indefinitely. One obvious sign we are chasing shiny here is the German-to-SQL example. This is fun, but no one would actually pay for it. I would classify Text-to-SQL as a Schedule I rab…

>The trouble is that it works just enough to be dangerous.

This is a major theme with LLMs. When they first came out you'd see it randomly returning garbage in the middle of an otherwise good output maybe 30% of the time. You knew you had to go through it with a fine tooth comb.

Now it's more like 3%. And you just gloss over it.

I think you are right about Text-to-SQL being a trap. In this case the deficiencies are unaccaptable.

But elsewhere? I think we are going to see the "customer service effect" applied all over the place. I am referring to the downward trend of customer service. Where quality was eschewed for scale. We went from highly competent agents providing individual feedback to hard to reach agents with no agency. It scales, but the bar has been lowered significantly. You get less customer service.

I think AI begs for the same tradeoff. Settle for less because it makes some things easier. Which of course makes other things much more complex or even undermines the entire premise.

Re: Text-to-SQL is dead, long live text-to-SQL

#15

What is the human need to bash SQL at all costs? At its core, such a simple syntax, yet its so powerful at aggregating/manipulating tabular data and the like. Instead we’d rather declaratively say what we want in a more verbose/disjointed way… fascinating

I'm with you. The more SQL alternatives I've seen, the more I'm convinced that SQL doesn't have that much fat or disfunction in it's syntax. There is inherent complexity. Follow an SQL-killer's guide far enough and you will see them quietly reintroduce the very same abstractions SQL solved decades ago.

Re: Text-to-SQL is dead, long live text-to-SQL

#16

What is the human need to bash SQL at all costs? At its core, such a simple syntax, yet its so powerful at aggregating/manipulating tabular data and the like. Instead we’d rather declaratively say what we want in a more verbose/disjointed way… fascinating

When you're having to work with someone else's godawful convoluted database schema you're sometimes really happy not to have to write the query yourself. Giving the LLM context with previously written queries can be quite effective.

The writing SQL experience is a product of both SQL's syntax, the structure of the database you're querying over and the complexity of your query.

When things get hairy, and you have a good number of representative queries already written that you can use as context, LLMs can be really nice tool.

Re: Text-to-SQL is dead, long live text-to-SQL

#17

What is the human need to bash SQL at all costs? At its core, such a simple syntax, yet its so powerful at aggregating/manipulating tabular data and the like. Instead we’d rather declaratively say what we want in a more verbose/disjointed way… fascinating

For me SQL feels like PHP. Sure it's usable, but it doesn't spark joy.

Syntactically PRQL is much simpler, cleaner and more flexible. You simply chain pipeline stages instead of having a single monolithic query statement.

Data model wise EdgeQL is close to what I want (links instead of joins, optionality instead of null, nesting support), but it's syntax is almost as bad as SQL.

Re: Text-to-SQL is dead, long live text-to-SQL

#18
But SQL is text, that's the whole point of it.

Sure, you have to phrase your question in a way that's a bit like trying to ask a very specific question of an annoying "Self-Diagnosed Internet Autistic" co-worker who can't tell the difference between being "precise" and being "a pedantic pain in the arse", but it is just text.

Oh you're upset because SQL isn't in German? Well there's no reason why you can't stick German into the lexer, set your columns up with German names, and get a query like

    WAHLEN_SIE zeielen_id, benutzer_namen, eingetragen
    AUS benutzern WO aktiviert = WAHR
    SORTIEREN NACH registrierungs_datum;
people who can really speak German, ja ich weiss meine Deutsch is so schlect, geh schon ;-)

But really why would you bother?

Re: Text-to-SQL is dead, long live text-to-SQL

#19
post #4

Long term, SQL will be phased out for new LLM-friendly query languages. The cost of AI generating tens of billions of queries per day creates a new incentive for rationality and efficiency that overcomes the human institutional weight of legacy languages. I'm working on such a language now: https://memelang.net/

I've always found it odd that most databases don't expose a kind of query bytecode API that SQL can be converted to. It would allow more kinds of languages, different SQL dialects, compile-time optimizations, and perhaps ORM could be compiled directly into your target database spec. Would reduce the amount of string operations by client code, at least

For translation between dialects, you could use projects such as SQLGlot. The advantage of SQL is the standardization over many decades (yes, I know that it's still a mess with the different dialects).

Re: Text-to-SQL is dead, long live text-to-SQL

#20
post #4

Long term, SQL will be phased out for new LLM-friendly query languages. The cost of AI generating tens of billions of queries per day creates a new incentive for rationality and efficiency that overcomes the human institutional weight of legacy languages. I'm working on such a language now: https://memelang.net/

That doesn't make sense. LLMs will be used to write SQL, I'm sure (I do that) but replacing SQL?

I do agree. SQL is simply an access API for so many systems, and nice as it's a declarative language rather than a normal programming language. LLMs are super powerful to express questions to data that can then be translated into SQL.
Post reply on HN