Java Code Examples for org.apache.calcite.sql.SqlDelete#getTargetTable()

The following examples show how to use org.apache.calcite.sql.SqlDelete#getTargetTable() . 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: SqlValidatorImpl.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the SELECT statement that putatively feeds rows into a DELETE
 * statement to be deleted.
 *
 * @param call Call to the DELETE operator
 * @return select statement
 */
protected SqlSelect createSourceSelectForDelete(SqlDelete call) {
	final SqlNodeList selectList = new SqlNodeList(SqlParserPos.ZERO);
	selectList.add(SqlIdentifier.star(SqlParserPos.ZERO));
	SqlNode sourceTable = call.getTargetTable();
	if (call.getAlias() != null) {
		sourceTable =
			SqlValidatorUtil.addAlias(
				sourceTable,
				call.getAlias().getSimple());
	}
	return new SqlSelect(SqlParserPos.ZERO, null, selectList, sourceTable,
		call.getCondition(), null, null, null, null, null, null);
}
 
Example 2
Source File: SqlValidatorImpl.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the SELECT statement that putatively feeds rows into a DELETE
 * statement to be deleted.
 *
 * @param call Call to the DELETE operator
 * @return select statement
 */
protected SqlSelect createSourceSelectForDelete(SqlDelete call) {
	final SqlNodeList selectList = new SqlNodeList(SqlParserPos.ZERO);
	selectList.add(SqlIdentifier.star(SqlParserPos.ZERO));
	SqlNode sourceTable = call.getTargetTable();
	if (call.getAlias() != null) {
		sourceTable =
			SqlValidatorUtil.addAlias(
				sourceTable,
				call.getAlias().getSimple());
	}
	return new SqlSelect(SqlParserPos.ZERO, null, selectList, sourceTable,
		call.getCondition(), null, null, null, null, null, null);
}
 
Example 3
Source File: SqlValidatorImpl.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
DeleteNamespace(SqlValidatorImpl validator, SqlDelete node,
	SqlNode enclosingNode, SqlValidatorScope parentScope) {
	super(validator, node.getTargetTable(), enclosingNode, parentScope);
	this.node = Objects.requireNonNull(node);
}
 
Example 4
Source File: SqlValidatorImpl.java    From flink with Apache License 2.0 4 votes vote down vote up
DeleteNamespace(SqlValidatorImpl validator, SqlDelete node,
	SqlNode enclosingNode, SqlValidatorScope parentScope) {
	super(validator, node.getTargetTable(), enclosingNode, parentScope);
	this.node = Objects.requireNonNull(node);
}