We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public static boolean hasAggregateFunction(String sql) { return !CollectionUtils.isEmpty(getFunctions(sql)); } public static Set<String> getFunctions(String sql) { Set<Select> allSelect = SqlSelectHelper.getAllSelect(sql); Set<String> result = new HashSet<>(); for (Select select : allSelect) { if (!(select instanceof PlainSelect)) { continue; } PlainSelect plainSelect = (PlainSelect) select; List<SelectItem<?>> selectItems = plainSelect.getSelectItems(); FunctionVisitor visitor = new FunctionVisitor(); for (SelectItem selectItem : selectItems) { selectItem.accept(visitor); } result.addAll(visitor.getFunctionNames()); } return result; }
getFunctions 获取到 SQL 中所有的函数(不仅仅是聚合函数),那这里的 hasAggregateFunction 判断定是否含有聚合函数是否还成立?
QueryTypeParser 调用该方法受到影响。不太理解望解答
none
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe your question
getFunctions 获取到 SQL 中所有的函数(不仅仅是聚合函数),那这里的 hasAggregateFunction 判断定是否含有聚合函数是否还成立?
QueryTypeParser 调用该方法受到影响。不太理解望解答
Your organization
none
The text was updated successfully, but these errors were encountered: