热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.calcite.sql.SqlNode.validate()方法的使用及代码示例

本文整理了Java中org.apache.calcite.sql.SqlNode.validate()方法的一些代码示例,展示了SqlNode.valida

本文整理了Java中org.apache.calcite.sql.SqlNode.validate()方法的一些代码示例,展示了SqlNode.validate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SqlNode.validate()方法的具体详情如下:
包路径:org.apache.calcite.sql.SqlNode
类名称:SqlNode
方法名:validate

SqlNode.validate介绍

[英]Validates this node.

The typical implementation of this method will make a callback to the validator appropriate to the node type and context. The validator has methods such as SqlValidator#validateLiteral for these purposes.
[中]验证此节点。
此方法的典型实现将根据节点类型和上下文对验证器进行回调。出于这些目的,验证器有一些方法,比如SqlValidator#validateLiteral。

代码示例

代码示例来源:origin: apache/flink

private SqlNode validateScopedExpression(
SqlNode topNode,
SqlValidatorScope scope) {
SqlNode outermostNode = performUnconditionalRewrites(topNode, false);
cursorSet.add(outermostNode);
top = outermostNode;
TRACER.trace("After unconditional rewrite: {}", outermostNode);
if (outermostNode.isA(SqlKind.TOP_LEVEL)) {
registerQuery(scope, null, outermostNode, outermostNode, null, false);
}
outermostNode.validate(this, scope);
if (!outermostNode.isA(SqlKind.TOP_LEVEL)) {
// force type derivation so that we can provide it to the
// caller later without needing the scope
deriveType(scope, outermostNode);
}
TRACER.trace("After validation: {}", outermostNode);
return outermostNode;
}

代码示例来源:origin: apache/flink

case ROLLUP:
case CUBE:
node.validate(this, groupScope);
break;
default:

代码示例来源:origin: apache/flink

protected void validateWhereOrOn(
SqlValidatorScope scope,
SqlNode condition,
String clause) {
validateNoAggs(aggOrOverOrGroupFinder, condition, clause);
inferUnknownTypes(
booleanType,
scope,
condition);
condition.validate(this, scope);
final RelDataType type = deriveType(scope, condition);
if (!SqlTypeUtil.inBooleanFamily(type)) {
throw newValidationError(condition, RESOURCE.condMustBeBoolean(clause));
}
}

代码示例来源:origin: Qihoo360/Quicksql

case ROLLUP:
case CUBE:
node.validate(this, groupScope);
break;
default:

代码示例来源:origin: apache/flink

protected void validateHavingClause(SqlSelect select) {
// HAVING is validated in the scope after groups have been created.
// For example, in "SELECT empno FROM emp WHERE empno = 10 GROUP BY
// deptno HAVING empno = 10", the reference to 'empno' in the HAVING
// clause is illegal.
SqlNode having = select.getHaving();
if (having == null) {
return;
}
final AggregatingScope havingScope =
(AggregatingScope) getSelectScope(select);
if (getConformance().isHavingAlias()) {
SqlNode newExpr = expandGroupByOrHavingExpr(having, havingScope, select, true);
if (having != newExpr) {
having = newExpr;
select.setHaving(newExpr);
}
}
havingScope.checkAggregateExpr(having, true);
inferUnknownTypes(
booleanType,
havingScope,
having);
having.validate(this, havingScope);
final RelDataType type = deriveType(havingScope, having);
if (!SqlTypeUtil.inBooleanFamily(type)) {
throw newValidationError(having, RESOURCE.havingMustBeBoolean());
}
}

代码示例来源:origin: apache/flink

expand.validate(this, scope);

代码示例来源:origin: apache/flink

if (orderBy != null) {
for (SqlNode node : orderBy) {
node.validate(this, scope);
SqlIdentifier identifier = null;
if (node instanceof SqlBasicCall) {

代码示例来源:origin: apache/flink

operand.validate(this, scope);

代码示例来源:origin: Qihoo360/Quicksql

public void validate(SqlValidator validator, SqlValidatorScope scope) {
for (SqlNode child : list) {
child.validate(validator, scope);
}
}

代码示例来源:origin: org.apache.calcite/calcite-core

public void validate(SqlValidator validator, SqlValidatorScope scope) {
for (SqlNode child : list) {
child.validate(validator, scope);
}
}

代码示例来源:origin: org.apache.calcite/calcite-core

/**
* Validates this node in an expression context.
*
*

Usually, this method does much the same as {@link #validate}, but a
* {@link SqlIdentifier} can occur in expression and non-expression
* contexts.
*/
public void validateExpr(
SqlValidator validator,
SqlValidatorScope scope) {
validate(validator, scope);
Util.discard(validator.deriveType(scope, this));
}

代码示例来源:origin: Qihoo360/Quicksql

/**
* Validates this node in an expression context.
*
*

Usually, this method does much the same as {@link #validate}, but a
* {@link SqlIdentifier} can occur in expression and non-expression
* contexts.
*/
public void validateExpr(
SqlValidator validator,
SqlValidatorScope scope) {
validate(validator, scope);
Util.discard(validator.deriveType(scope, this));
}

代码示例来源:origin: Qihoo360/Quicksql

private SqlNode validateScopedExpression(
SqlNode topNode,
SqlValidatorScope scope) {
SqlNode outermostNode = performUnconditionalRewrites(topNode, false);
cursorSet.add(outermostNode);
top = outermostNode;
TRACER.trace("After unconditional rewrite: {}", outermostNode);
if (outermostNode.isA(SqlKind.TOP_LEVEL)) {
registerQuery(scope, null, outermostNode, outermostNode, null, false);
}
outermostNode.validate(this, scope);
if (!outermostNode.isA(SqlKind.TOP_LEVEL)) {
// force type derivation so that we can provide it to the
// caller later without needing the scope
deriveType(scope, outermostNode);
}
TRACER.trace("After validation: {}", outermostNode);
return outermostNode;
}

代码示例来源:origin: org.apache.calcite/calcite-core

private SqlNode validateScopedExpression(
SqlNode topNode,
SqlValidatorScope scope) {
SqlNode outermostNode = performUnconditionalRewrites(topNode, false);
cursorSet.add(outermostNode);
top = outermostNode;
TRACER.trace("After unconditional rewrite: {}", outermostNode);
if (outermostNode.isA(SqlKind.TOP_LEVEL)) {
registerQuery(scope, null, outermostNode, outermostNode, null, false);
}
outermostNode.validate(this, scope);
if (!outermostNode.isA(SqlKind.TOP_LEVEL)) {
// force type derivation so that we can provide it to the
// caller later without needing the scope
deriveType(scope, outermostNode);
}
TRACER.trace("After validation: {}", outermostNode);
return outermostNode;
}

代码示例来源:origin: org.apache.calcite/calcite-core

protected void validateWhereOrOn(
SqlValidatorScope scope,
SqlNode condition,
String clause) {
validateNoAggs(aggOrOverOrGroupFinder, condition, clause);
inferUnknownTypes(
booleanType,
scope,
condition);
condition.validate(this, scope);
final RelDataType type = deriveType(scope, condition);
if (!SqlTypeUtil.inBooleanFamily(type)) {
throw newValidationError(condition, RESOURCE.condMustBeBoolean(clause));
}
}

代码示例来源:origin: Qihoo360/Quicksql

protected void validateWhereOrOn(
SqlValidatorScope scope,
SqlNode condition,
String clause) {
validateNoAggs(aggOrOverOrGroupFinder, condition, clause);
inferUnknownTypes(
booleanType,
scope,
condition);
condition.validate(this, scope);
final RelDataType type = deriveType(scope, condition);
if (!SqlTypeUtil.inBooleanFamily(type)) {
throw newValidationError(condition, RESOURCE.condMustBeBoolean(clause));
}
}

代码示例来源:origin: org.apache.calcite/calcite-core

protected void validateHavingClause(SqlSelect select) {
// HAVING is validated in the scope after groups have been created.
// For example, in "SELECT empno FROM emp WHERE empno = 10 GROUP BY
// deptno HAVING empno = 10", the reference to 'empno' in the HAVING
// clause is illegal.
SqlNode having = select.getHaving();
if (having == null) {
return;
}
final AggregatingScope havingScope =
(AggregatingScope) getSelectScope(select);
if (getConformance().isHavingAlias()) {
SqlNode newExpr = expandGroupByOrHavingExpr(having, havingScope, select, true);
if (having != newExpr) {
having = newExpr;
select.setHaving(newExpr);
}
}
havingScope.checkAggregateExpr(having, true);
inferUnknownTypes(
booleanType,
havingScope,
having);
having.validate(this, havingScope);
final RelDataType type = deriveType(havingScope, having);
if (!SqlTypeUtil.inBooleanFamily(type)) {
throw newValidationError(having, RESOURCE.havingMustBeBoolean());
}
}

代码示例来源:origin: Qihoo360/Quicksql

protected void validateHavingClause(SqlSelect select) {
// HAVING is validated in the scope after groups have been created.
// For example, in "SELECT empno FROM emp WHERE empno = 10 GROUP BY
// deptno HAVING empno = 10", the reference to 'empno' in the HAVING
// clause is illegal.
SqlNode having = select.getHaving();
if (having == null) {
return;
}
final AggregatingScope havingScope =
(AggregatingScope) getSelectScope(select);
if (getConformance().isHavingAlias()) {
SqlNode newExpr = expandGroupByOrHavingExpr(having, havingScope, select, true);
if (having != newExpr) {
having = newExpr;
select.setHaving(newExpr);
}
}
havingScope.checkAggregateExpr(having, true);
inferUnknownTypes(
booleanType,
havingScope,
having);
having.validate(this, havingScope);
final RelDataType type = deriveType(havingScope, having);
if (!SqlTypeUtil.inBooleanFamily(type)) {
throw newValidationError(having, RESOURCE.havingMustBeBoolean());
}
}

代码示例来源:origin: org.apache.calcite/calcite-core

expand.validate(this, scope);

代码示例来源:origin: Qihoo360/Quicksql

expand.validate(this, scope);

推荐阅读
  • 本文整理了Java中org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc.getTypeInfo()方法的一些代码示例,展 ... [详细]
  • ALTERTABLE通过更改、添加、除去列和约束,或者通过启用或禁用约束和触发器来更改表的定义。语法ALTERTABLEtable{[ALTERCOLUMNcolu ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 前景:当UI一个查询条件为多项选择,或录入多个条件的时候,比如查询所有名称里面包含以下动态条件,需要模糊查询里面每一项时比如是这样一个数组条件:newstring[]{兴业银行, ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 本文整理了Java中org.apache.solr.common.SolrDocument.setField()方法的一些代码示例,展示了SolrDocum ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 本文详细介绍了在ASP.NET中获取插入记录的ID的几种方法,包括使用SCOPE_IDENTITY()和IDENT_CURRENT()函数,以及通过ExecuteReader方法执行SQL语句获取ID的步骤。同时,还提供了使用这些方法的示例代码和注意事项。对于需要获取表中最后一个插入操作所产生的ID或马上使用刚插入的新记录ID的开发者来说,本文提供了一些有用的技巧和建议。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 本文详细介绍了Spring的JdbcTemplate的使用方法,包括执行存储过程、存储函数的call()方法,执行任何SQL语句的execute()方法,单个更新和批量更新的update()和batchUpdate()方法,以及单查和列表查询的query()和queryForXXX()方法。提供了经过测试的API供使用。 ... [详细]
  • 标题: ... [详细]
  • 本文介绍了如何使用C#制作Java+Mysql+Tomcat环境安装程序,实现一键式安装。通过将JDK、Mysql、Tomcat三者制作成一个安装包,解决了客户在安装软件时的复杂配置和繁琐问题,便于管理软件版本和系统集成。具体步骤包括配置JDK环境变量和安装Mysql服务,其中使用了MySQL Server 5.5社区版和my.ini文件。安装方法为通过命令行将目录转到mysql的bin目录下,执行mysqld --install MySQL5命令。 ... [详细]
author-avatar
cxl
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有