public class SqlSetOption extends SqlAlter
SET and RESET statements,
optionally preceded by ALTER SYSTEM or ALTER SESSION.
Syntax:
ALTER scope SET `option.name` = value;
ALTER scope RESET `option`.`name`;
ALTER scope RESET ALL;
SET `option.name` = value;
RESET `option`.`name`;
RESET ALL;
If SqlAlter.scope is null, assume a default scope. (The default scope
is defined by the project using Calcite, but is typically SESSION.)
If value is null, assume RESET;
if value is not null, assume SET.
Examples:
ALTER SYSTEM SET `my`.`param1` = 1SET `my.param2` = 1SET `my.param3` = ONALTER SYSTEM RESET `my`.`param1`RESET `my.param2`ALTER SESSION RESET ALL| Modifier and Type | Field and Description |
|---|---|
static SqlSpecialOperator |
OPERATOR |
EMPTY_ARRAY, pos| Constructor and Description |
|---|
SqlSetOption(SqlParserPos pos,
@Nullable String scope,
SqlIdentifier name,
@Nullable SqlNode value)
Creates a node.
|
| Modifier and Type | Method and Description |
|---|---|
SqlKind |
getKind()
Returns the type of node this is, or
SqlKind.OTHER if it's nothing special. |
SqlIdentifier |
getName() |
List<SqlNode> |
getOperandList()
Returns the list of operands.
|
SqlOperator |
getOperator() |
@Nullable SqlNode |
getValue() |
void |
setName(SqlIdentifier name) |
void |
setOperand(int i,
@Nullable SqlNode operand)
Changes the value of an operand.
|
void |
setValue(SqlNode value) |
protected void |
unparseAlterOperation(SqlWriter writer,
int leftPrec,
int rightPrec) |
void |
validate(SqlValidator validator,
SqlValidatorScope scope)
Validates this call.
|
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getMonotonicity, isCountStar, isExpanded, operand, operandCountclone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExprpublic static final SqlSpecialOperator OPERATOR
public SqlSetOption(SqlParserPos pos, @Nullable String scope, SqlIdentifier name, @Nullable SqlNode value)
pos - Parser position, must not be null.scope - Scope (generally "SYSTEM" or "SESSION"), may be null.name - Name of option, as an identifier, must not be null.value - Value of option, as an identifier or literal, may be null.
If null, assume RESET command, else assume SET command.public SqlKind getKind()
SqlNodeSqlKind.OTHER if it's nothing special.getKind in class SqlCallSqlKind value, never nullSqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>)public SqlOperator getOperator()
getOperator in class SqlCallpublic List<SqlNode> getOperandList()
SqlCallNote: the proper type would be List<@Nullable SqlNode>, however,
it would trigger too many changes to the current codebase.
getOperandList in class SqlCallpublic void setOperand(int i,
@Nullable SqlNode operand)
SqlCallSqlValidator; use sparingly.setOperand in class SqlCalli - Operand indexoperand - Operand valueprotected void unparseAlterOperation(SqlWriter writer, int leftPrec, int rightPrec)
unparseAlterOperation in class SqlAlterpublic void validate(SqlValidator validator, SqlValidatorScope scope)
SqlCallThe default implementation delegates the validation to the operator's
SqlOperator.validateCall(org.apache.calcite.sql.SqlCall, org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.validate.SqlValidatorScope). Derived classes may override (as do,
for example SqlSelect and SqlUpdate).
public SqlIdentifier getName()
public void setName(SqlIdentifier name)
public @Nullable SqlNode getValue()
public void setValue(SqlNode value)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.