Java Code Examples for org.apache.calcite.sql.SqlNodeList#accept()

The following examples show how to use org.apache.calcite.sql.SqlNodeList#accept() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RuleParser.java    From streamline with Apache License 2.0 5 votes vote down vote up
private GroupBy parseGroupBy(SqlSelect sqlSelect) {
    GroupBy groupBy = null;
    SqlNodeList sqlGroupBy = sqlSelect.getGroup();
    if (sqlGroupBy != null) {
        ExpressionGenerator exprGenerator = new ExpressionGenerator(streams, catalogUdfs);
        ExpressionList exprList = (ExpressionList) sqlGroupBy.accept(exprGenerator);
        groupBy = new GroupBy(exprList.getExpressions());
        referredUdfs.addAll(exprGenerator.getReferredUdfs());
    }
    LOG.debug("GroupBy {}", groupBy);
    return groupBy;
}
 
Example 2
Source File: SqlValidatorUtil.java    From Bats with Apache License 2.0 4 votes vote down vote up
/** Copies a list of nodes. */
public static SqlNodeList copy(SqlValidatorScope scope, SqlNodeList list) {
  //noinspection deprecation
  return (SqlNodeList) list.accept(new DeepCopier(scope));
}
 
Example 3
Source File: HiveDDLUtils.java    From flink with Apache License 2.0 4 votes vote down vote up
public static void unescapeProperties(SqlNodeList properties) {
	if (properties != null) {
		properties.accept(UNESCAPE_SHUTTLE);
	}
}
 
Example 4
Source File: HiveDDLUtils.java    From flink with Apache License 2.0 4 votes vote down vote up
public static void unescapePartitionSpec(SqlNodeList partSpec) {
	if (partSpec != null) {
		partSpec.accept(UNESCAPE_SHUTTLE);
	}
}
 
Example 5
Source File: SqlValidatorUtil.java    From calcite with Apache License 2.0 4 votes vote down vote up
/** Copies a list of nodes. */
public static SqlNodeList copy(SqlValidatorScope scope, SqlNodeList list) {
  //noinspection deprecation
  return (SqlNodeList) list.accept(new DeepCopier(scope));
}