org.apache.calcite.sql.SqlAccessType Java Examples

The following examples show how to use org.apache.calcite.sql.SqlAccessType. 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
/**
 * 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 File: SqlValidatorImpl.java    From flink with 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 File: DelegatingSqlValidatorTable.java    From Bats with Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return table.getAllowedAccess();
}
 
Example #4
Source File: RelOptTableImpl.java    From Bats with Apache License 2.0 4 votes vote down vote up
@Override
public SqlAccessType getAllowedAccess() {
    return SqlAccessType.ALL;
}
 
Example #5
Source File: DremioPrepareTable.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example #6
Source File: TestSQLAnalyzer.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example #7
Source File: RelOptTableImpl.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example #8
Source File: DelegatingSqlValidatorTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return table.getAllowedAccess();
}
 
Example #9
Source File: MockCatalogReader.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SqlAccessType getAllowedAccess() {
  return SqlAccessType.ALL;
}
 
Example #10
Source File: SqlValidatorTable.java    From Bats with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the access type of the table
 */
SqlAccessType getAllowedAccess();
 
Example #11
Source File: FlinkPreparingTableBase.java    From flink with 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 File: SqlValidatorTable.java    From calcite with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the access type of the table
 */
SqlAccessType getAllowedAccess();