作者:倩倩倩倩倩倩雯- | 来源:互联网 | 2023-08-30 09:33
本文整理了Java中com.facebook.presto.sql.QueryUtil.unmangleFieldReference方法的一些代码示例,展示了
本文整理了Java中com.facebook.presto.sql.QueryUtil.unmangleFieldReference
方法的一些代码示例,展示了QueryUtil.unmangleFieldReference
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryUtil.unmangleFieldReference
方法的具体详情如下:
包路径:com.facebook.presto.sql.QueryUtil
类名称:QueryUtil
方法名:unmangleFieldReference
QueryUtil.unmangleFieldReference介绍
暂无
代码示例
代码示例来源:origin: vqtran/EchoQuery
@Override
protected String visitFunctionCall(FunctionCall node, Boolean unmangleNames)
{
StringBuilder builder = new StringBuilder();
String arguments = joinExpressions(node.getArguments(), unmangleNames);
if (node.getArguments().isEmpty() && "count".equalsIgnoreCase(node.getName().getSuffix())) {
arguments = "*";
}
if (node.isDistinct()) {
arguments = "DISTINCT " + arguments;
}
if (unmangleNames && node.getName().toString().startsWith(QueryUtil.FIELD_REFERENCE_PREFIX)) {
checkState(node.getArguments().size() == 1, "Expected only one argument to field reference");
QualifiedName name = QualifiedName.of(QueryUtil.unmangleFieldReference(node.getName().toString()));
builder.append(arguments).append(".").append(name);
}
else {
builder.append(formatQualifiedName(node.getName()))
.append('(').append(arguments).append(')');
}
if (node.getWindow().isPresent()) {
builder.append(" OVER ").append(visitWindow(node.getWindow().get(), unmangleNames));
}
return builder.toString();
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-parser
@Override
protected String visitFunctionCall(FunctionCall node, Boolean unmangleNames)
{
StringBuilder builder = new StringBuilder();
String arguments = joinExpressions(node.getArguments(), unmangleNames);
if (node.getArguments().isEmpty() && "count".equalsIgnoreCase(node.getName().getSuffix())) {
arguments = "*";
}
if (node.isDistinct()) {
arguments = "DISTINCT " + arguments;
}
if (unmangleNames && node.getName().toString().startsWith(QueryUtil.FIELD_REFERENCE_PREFIX)) {
checkState(node.getArguments().size() == 1, "Expected only one argument to field reference");
QualifiedName name = QualifiedName.of(QueryUtil.unmangleFieldReference(node.getName().toString()));
builder.append(arguments).append(".").append(name);
}
else {
builder.append(formatQualifiedName(node.getName()))
.append('(').append(arguments).append(')');
}
if (node.getWindow().isPresent()) {
builder.append(" OVER ").append(visitWindow(node.getWindow().get(), unmangleNames));
}
return builder.toString();
}