mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 06:27:21 +00:00
[improvement][chat]Sort parses in NL2SQLParser right after rule-based parsing.
This commit is contained in:
@@ -98,6 +98,15 @@ public class SemanticParseInfo {
|
||||
}
|
||||
}
|
||||
|
||||
public static void sort(List<SemanticParseInfo> parses) {
|
||||
parses.sort(new SemanticParseComparator());
|
||||
// re-assign parseId
|
||||
for (int i = 0; i < parses.size(); i++) {
|
||||
SemanticParseInfo parseInfo = parses.get(i);
|
||||
parseInfo.setId(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private static class SchemaNameLengthComparator implements Comparator<SchemaElement> {
|
||||
@Override
|
||||
public int compare(SchemaElement o1, SchemaElement o2) {
|
||||
|
||||
Reference in New Issue
Block a user