mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
[improvement](chat) Add a LLMParserLayer to interact with a Python service and add comments to certain classes (#388)
This commit is contained in:
@@ -166,7 +166,7 @@ public class SqlParserSelectHelper {
|
||||
return new ArrayList<>(results);
|
||||
}
|
||||
|
||||
private static ArrayList<String> getFieldsByPlainSelect(PlainSelect plainSelect) {
|
||||
private static List<String> getFieldsByPlainSelect(PlainSelect plainSelect) {
|
||||
if (Objects.isNull(plainSelect)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
@@ -396,9 +396,7 @@ public class SqlParserSelectHelper {
|
||||
}
|
||||
SelectBody selectBody = selectStatement.getSelectBody();
|
||||
PlainSelect plainSelect = (PlainSelect) selectBody;
|
||||
|
||||
Table table = (Table) plainSelect.getFromItem();
|
||||
return table;
|
||||
return (Table) plainSelect.getFromItem();
|
||||
}
|
||||
|
||||
public static String getDbTableName(String sql) {
|
||||
@@ -406,5 +404,12 @@ public class SqlParserSelectHelper {
|
||||
return table.getFullyQualifiedName();
|
||||
}
|
||||
|
||||
public static String getNormalizedSql(String sql) {
|
||||
Select selectStatement = getSelect(sql);
|
||||
if (selectStatement == null) {
|
||||
return null;
|
||||
}
|
||||
return selectStatement.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user