-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distance measure implementation (#1527)
* Added distance measure calculation * code refactor * minor fixes * removed database data from constant.py * bug fixes * refactor * improved code logic and added comments * integrated distance measurement to the sql checker * improved duplicate flagging logic * chore(sql-checker): remove __pycache__ * only the closest distance gets saved on the database now * Subqueries and "AND","OR" operators work * Fixed lint problems and started implementing LIKE, BETWEEN, IN support * style(sql-distance-checker): fix style * chore(sql-checker): fix pylint errors * refactor(sql-checker): apply ioc and add tests * feat(sql-checker): add distances to checker output * feat(sql-checker): reimplement query comparision * fix(sql-checker): fix query learning * fix(sql-parser): fix different query lengths * feat(sql-checker): add error depth * style(sql-checker): fix style * chore(sql-checker): remove print * feat(sql-checker): divide distance by 50 and round * feat(sql-checker): improve feedback * feat(sql-checker): make distance disableable * fix(sql-checker): move mongomock into dev dependencies * ci(python): install all dependencies for testing * ci(python): update to python 3.11 * ci(python): update other to python 3.11 * ci(python): fix unittests --------- Co-authored-by: Jonas Kuche <[email protected]> Co-authored-by: chrastlet <[email protected]>
- Loading branch information
1 parent
b6d3511
commit 82283c7
Showing
57 changed files
with
8,649 additions
and
1,505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
modules/fbs-core/api/src/main/scala/de/thm/ii/fbs/model/SQLCheckerQuery.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
package de.thm.ii.fbs.model | ||
|
||
import java.util | ||
import java.util.Optional | ||
|
||
case class SQLCheckerQuery(id: String, taskNumber: String, statement: String, queryRight: Boolean, parsable: Boolean, | ||
case class SQLCheckerError(expected: String, got: String, trace: util.List[String]) | ||
|
||
case class SQLCheckerQuery(id: String, taskNumber: String, statement: String, parsable: Boolean, | ||
queryRight: Optional[Boolean], passed: Optional[Boolean], | ||
tablesRight: Optional[Boolean], proAttributesRight: Optional[Boolean], selAttributesRight: Optional[Boolean], | ||
stringsRight: Optional[Boolean], orderByRight: Optional[Boolean], groupByRight: Optional[Boolean], | ||
joinsRight: Optional[Boolean], wildcards: Optional[Boolean], userId: Int, attempt: Int) | ||
joinsRight: Optional[Boolean], wildcards: Optional[Boolean], distance: Optional[Int], userId: Int, attempt: Int, | ||
version: Optional[String], errors: util.List[SQLCheckerError], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.