FuncEvalGMN: Evaluating Functional Correctness of SQL via Graph Matching Network

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Zhan, Yi, Sun, Yang, Weng, Han, Cui, Longjie, Wang, Guifeng, Xie, Jiajun, Tian, Yu, Yin, Xiaoming, Liu, Boyi, Huang, Dongchi
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929428746993664
author Zhan, Yi
Sun, Yang
Weng, Han
Cui, Longjie
Wang, Guifeng
Xie, Jiajun
Tian, Yu
Yin, Xiaoming
Liu, Boyi
Huang, Dongchi
author_facet Zhan, Yi
Sun, Yang
Weng, Han
Cui, Longjie
Wang, Guifeng
Xie, Jiajun
Tian, Yu
Yin, Xiaoming
Liu, Boyi
Huang, Dongchi
contents In this paper, we propose a novel graph-based methodology to evaluate the functional correctness of SQL generation. Conventional metrics for assessing SQL code generation, such as matching-based and execution-based methods (e.g., exact set match and execution accuracy), are subject to two primary limitations. Firstly, the former fails to effectively assess functional correctness, as different SQL queries may possess identical functionalities. Secondly, the latter is susceptible to producing false positive samples in evaluations. Our proposed evaluation method, \texttt{FuncEvalGMN}, does not depend on the sufficient preparation of the test data, and it enables precise testing of the functional correctness of the code. Firstly, we parse SQL using a relational operator tree (ROT) called \textit{Relnode}, which contains rich semantic information from the perspective of logical execution.Then, we introduce a GNN-based approach for predicting the functional correctness of generated SQL. This approach incorporates global positional embeddings to address the limitations with the loss of topological information in conventional graph matching frameworks. As an auxiliary contribution, we propose a rule-based matching algorithm, Relnode Partial Matching (\texttt{RelPM}) as a baseline. Finally, we contribute a dataset, \texttt{Pair-Aug-Spider} with a training set and two testing sets, each comprising pairs of SQL codes to simulate various SQL code evaluation scenarios. The training set and one testing dataset focus on code generation using large language models (LLMs), while the other emphasizes SQL equivalence rewriting.
format Preprint
id arxiv_https___arxiv_org_abs_2407_14530
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle FuncEvalGMN: Evaluating Functional Correctness of SQL via Graph Matching Network
Zhan, Yi
Sun, Yang
Weng, Han
Cui, Longjie
Wang, Guifeng
Xie, Jiajun
Tian, Yu
Yin, Xiaoming
Liu, Boyi
Huang, Dongchi
Databases
Artificial Intelligence
In this paper, we propose a novel graph-based methodology to evaluate the functional correctness of SQL generation. Conventional metrics for assessing SQL code generation, such as matching-based and execution-based methods (e.g., exact set match and execution accuracy), are subject to two primary limitations. Firstly, the former fails to effectively assess functional correctness, as different SQL queries may possess identical functionalities. Secondly, the latter is susceptible to producing false positive samples in evaluations. Our proposed evaluation method, \texttt{FuncEvalGMN}, does not depend on the sufficient preparation of the test data, and it enables precise testing of the functional correctness of the code. Firstly, we parse SQL using a relational operator tree (ROT) called \textit{Relnode}, which contains rich semantic information from the perspective of logical execution.Then, we introduce a GNN-based approach for predicting the functional correctness of generated SQL. This approach incorporates global positional embeddings to address the limitations with the loss of topological information in conventional graph matching frameworks. As an auxiliary contribution, we propose a rule-based matching algorithm, Relnode Partial Matching (\texttt{RelPM}) as a baseline. Finally, we contribute a dataset, \texttt{Pair-Aug-Spider} with a training set and two testing sets, each comprising pairs of SQL codes to simulate various SQL code evaluation scenarios. The training set and one testing dataset focus on code generation using large language models (LLMs), while the other emphasizes SQL equivalence rewriting.
title FuncEvalGMN: Evaluating Functional Correctness of SQL via Graph Matching Network
topic Databases
Artificial Intelligence
url https://arxiv.org/abs/2407.14530