Java Code Examples for org.apache.calcite.sql.SqlDelete

The following examples show how to use org.apache.calcite.sql.SqlDelete. These examples are extracted from open source projects. 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 Project: Flink-CEPplus   Source File: SqlValidatorImpl.java    License: 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 Project: Flink-CEPplus   Source File: SqlValidatorImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void validateDelete(SqlDelete call) {
	final SqlSelect sqlSelect = call.getSourceSelect();
	validateSelect(sqlSelect, unknownType);

	final SqlValidatorNamespace targetNamespace = getNamespace(call);
	validateNamespace(targetNamespace, unknownType);
	final SqlValidatorTable table = targetNamespace.getTable();

	validateAccess(call.getTargetTable(), table, SqlAccessEnum.DELETE);
}
 
Example 3
Source Project: flink   Source File: SqlValidatorImpl.java    License: 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 4
Source Project: flink   Source File: SqlValidatorImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void validateDelete(SqlDelete call) {
	final SqlSelect sqlSelect = call.getSourceSelect();
	validateSelect(sqlSelect, unknownType);

	final SqlValidatorNamespace targetNamespace = getNamespace(call);
	validateNamespace(targetNamespace, unknownType);
	final SqlValidatorTable table = targetNamespace.getTable();

	validateAccess(call.getTargetTable(), table, SqlAccessEnum.DELETE);
}
 
Example 5
Source Project: Flink-CEPplus   Source File: SqlValidatorImpl.java    License: 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 6
Source Project: Flink-CEPplus   Source File: SqlValidatorImpl.java    License: Apache License 2.0 4 votes vote down vote up
public SqlDelete getNode() {
	return node;
}
 
Example 7
Source Project: flink   Source File: SqlValidatorImpl.java    License: 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 8
Source Project: flink   Source File: SqlValidatorImpl.java    License: Apache License 2.0 4 votes vote down vote up
public SqlDelete getNode() {
	return node;
}
 
Example 9
Source Project: Bats   Source File: SqlValidator.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Validates a DELETE statement.
 *
 * @param delete DELETE statement
 */
void validateDelete(SqlDelete delete);
 
Example 10
Source Project: calcite   Source File: SqlValidator.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Validates a DELETE statement.
 *
 * @param delete DELETE statement
 */
void validateDelete(SqlDelete delete);