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

The following examples show how to use org.apache.calcite.sql.SqlAccessType. 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
/**
 * Validates access to a table.
 *
 * @param table          Table
 * @param requiredAccess Access requested on table
 */
private void validateAccess(
	SqlNode node,
	SqlValidatorTable table,
	SqlAccessEnum requiredAccess) {
	if (table != null) {
		SqlAccessType access = table.getAllowedAccess();
		if (!access.allowsAccess(requiredAccess)) {
			throw newValidationError(node,
				RESOURCE.accessNotAllowed(requiredAccess.name(),
					table.getQualifiedName().toString()));
		}
	}
}
 
Example 2
Source Project: flink   Source File: SqlValidatorImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Validates access to a table.
 *
 * @param table          Table
 * @param requiredAccess Access requested on table
 */
private void validateAccess(
	SqlNode node,
	SqlValidatorTable table,
	SqlAccessEnum requiredAccess) {
	if (table != null) {
		SqlAccessType access = table.getAllowedAccess();
		if (!access.allowsAccess(requiredAccess)) {
			throw newValidationError(node,
				RESOURCE.accessNotAllowed(requiredAccess.name(),
					table.getQualifiedName().toString()));
		}
	}
}
 
Example 3
Source Project: Bats   Source File: DelegatingSqlValidatorTable.java    License: Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return table.getAllowedAccess();
}
 
Example 4
Source Project: Bats   Source File: RelOptTableImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SqlAccessType getAllowedAccess() {
    return SqlAccessType.ALL;
}
 
Example 5
Source Project: dremio-oss   Source File: DremioPrepareTable.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example 6
Source Project: dremio-oss   Source File: TestSQLAnalyzer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example 7
Source Project: calcite   Source File: RelOptTableImpl.java    License: Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example 8
Source Project: calcite   Source File: DelegatingSqlValidatorTable.java    License: Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return table.getAllowedAccess();
}
 
Example 9
Source Project: calcite   Source File: MockCatalogReader.java    License: Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example 10
Source Project: Bats   Source File: SqlValidatorTable.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns the access type of the table
 */
SqlAccessType getAllowedAccess();
 
Example 11
Source Project: flink   Source File: FlinkPreparingTableBase.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Obtains the access type of the table.
 *
 * @return all access types including SELECT/UPDATE/INSERT/DELETE
 */
public SqlAccessType getAllowedAccess() {
	return SqlAccessType.ALL;
}
 
Example 12
Source Project: calcite   Source File: SqlValidatorTable.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns the access type of the table
 */
SqlAccessType getAllowedAccess();