org.apache.calcite.sql.SqlDelete Java Examples

The following examples show how to use org.apache.calcite.sql.SqlDelete. 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-CEPplus with 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 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 #4
Source File: SqlValidatorImpl.java    From flink with 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 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 #6
Source File: SqlValidatorImpl.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public SqlDelete getNode() {
	return node;
}
 
Example #7
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);
}
 
Example #8
Source File: SqlValidatorImpl.java    From flink with Apache License 2.0 4 votes vote down vote up
public SqlDelete getNode() {
	return node;
}
 
Example #9
Source File: SqlValidator.java    From Bats with 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 File: SqlValidator.java    From calcite with Apache License 2.0 2 votes vote down vote up
/**
 * Validates a DELETE statement.
 *
 * @param delete DELETE statement
 */
void validateDelete(SqlDelete delete);