SQLGlot Implementation for Text2SQL Hallucination Detection - Technical Consultation #5932
-
Hi @tobymao, @georgesittas, @geooo109, and SQLGlot maintainers, We truly appreciate the excellent work on SQLGlot, it has been invaluable for our project. We are currently developing a hallucination detection module for our agentic framework that leverages SQLGlot to validate LLM-generated SQL queries against ground truth metadata which includes table and column information. Our approach encompasses three validation layers: 1. Syntax ValidationImplementation: 2. Dialect ValidationCurrent Approach: For the Dialect validation, we were using the Query 1: Could you please tell me what we are doing wrong? If possible could you please suggest a better way of going about this? 3. Schema ValidationCurrent Approach: For the Columns and tables validation we are using the following approach:
Query-2: How does this approach look? Are there any issues that you might foresee with this approach? Thank you for your time and consideration, we and look forward to your insights. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @jubinben98, I suggest that you post this question in our Slack channel– "GitHub Discussions" isn't as actively monitored. In any case...
|
Beta Was this translation helpful? Give feedback.
Hi @jubinben98, I suggest that you post this question in our Slack channel– "GitHub Discussions" isn't as actively monitored.
In any case...
sqlglot.optimizer.qualify
, I think it may solve some of your problems