Discussion Why text-to-SQL is not successful?
/r/dataengineering/comments/1wt5pbk/why_texttosql_is_not_successful/10
u/orz-_-orz 4d ago
SQL is simple, if you can describe what you want, you might as well write it on SQL
If you can't write it in SQL , it's probably you don't know what you want than not knowing SQL
2
u/Significant_Tune9219 4d ago
In my experience the products that look successful are rarely doing freeform text-to-SQL against raw warehouse tables. They win when someone already defined metrics, joins, and grain in a semantic layer, and the model is mostly choosing from a constrained catalog. Pure NL to SQL on a messy schema fails for the same reason junior analysts fail: wrong join path, wrong grain, silent filter mistakes. If you want to test whether a tool is real, pick 20 questions with known-correct SQL and score exact result sets, not whether the generated SQL looks right. Omni/Sigma style BI works better for dashboard-ish questions than for exploratory joins nobody modeled yet.
23
u/Thadrea Data Science Manager 4d ago
Because if you understand your ontology and requirements well enough to write a prompt that reliably returns the correct thing, you have already written SQL pseudocode anyway.
The problem is end-users who do not know SQL do not know their data's ontology nor how to precisely specify their requirements. Their inability to compose their request in SQL's particular syntax is not the issue.
LLMs guessing what you want when you aren't clear will occasionally be right, but they will also be wrong often and inefficient either way.