Java Code Examples for org.apache.calcite.sql.SqlKind#COLLECTION_TABLE

The following examples show how to use org.apache.calcite.sql.SqlKind#COLLECTION_TABLE . 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: FlinkCalciteSqlValidator.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
protected void validateJoin(SqlJoin join, SqlValidatorScope scope) {
	// Due to the improper translation of lateral table left outer join in Calcite, we need to
	// temporarily forbid the common predicates until the problem is fixed (see FLINK-7865).
	if (join.getJoinType() == JoinType.LEFT &&
			SqlUtil.stripAs(join.getRight()).getKind() == SqlKind.COLLECTION_TABLE) {
		final SqlNode condition = join.getCondition();
		if (condition != null &&
				(!SqlUtil.isLiteral(condition) || ((SqlLiteral) condition).getValueAs(Boolean.class) != Boolean.TRUE)) {
			throw new ValidationException(
				String.format(
					"Left outer joins with a table function do not accept a predicate such as %s. " +
					"Only literal TRUE is accepted.",
					condition));
		}
	}
	super.validateJoin(join, scope);
}
 
Example 2
Source File: FlinkCalciteSqlValidator.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
protected void validateJoin(SqlJoin join, SqlValidatorScope scope) {
	// Due to the improper translation of lateral table left outer join in Calcite, we need to
	// temporarily forbid the common predicates until the problem is fixed (see FLINK-7865).
	if (join.getJoinType() == JoinType.LEFT &&
			SqlUtil.stripAs(join.getRight()).getKind() == SqlKind.COLLECTION_TABLE) {
		final SqlNode condition = join.getCondition();
		if (condition != null &&
				(!SqlUtil.isLiteral(condition) || ((SqlLiteral) condition).getValueAs(Boolean.class) != Boolean.TRUE)) {
			throw new ValidationException(
				String.format(
					"Left outer joins with a table function do not accept a predicate such as %s. " +
					"Only literal TRUE is accepted.",
					condition));
		}
	}
	super.validateJoin(join, scope);
}
 
Example 3
Source File: SqlCollectionTableOperator.java    From Bats with Apache License 2.0 4 votes vote down vote up
public SqlCollectionTableOperator(String name, SqlModality modality) {
  super(name, SqlKind.COLLECTION_TABLE, 200, true, ReturnTypes.ARG0, null,
      OperandTypes.ANY);
  this.modality = modality;
}
 
Example 4
Source File: SqlCollectionTableOperator.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SqlCollectionTableOperator(String name, SqlModality modality) {
  super(name, SqlKind.COLLECTION_TABLE, 200, true, ReturnTypes.ARG0, null,
      OperandTypes.ANY);
  this.modality = modality;
}