CompoundParseNode(List<ParseNode> children) { this.children = Collections.unmodifiableList(children); boolean isStateless = true; for (ParseNode child : children) { isStateless &= child.isStateless(); if (!isStateless) { break; } } this.isStateless = isStateless; }
private static int countConstants(List<ParseNode> nodes) { int count = 0; for (int i = 0; i < nodes.size(); i++) { if (nodes.get(i).isStateless()) { count++; } } return count; }
@Override public ParseNode visitLeave(ComparisonParseNode node, List<ParseNode> nodes) throws SQLException { if (nodes.get(0).isStateless() && !nodes.get(1).isStateless() && !(nodes.get(1) instanceof ArrayElemRefNode)) { List<ParseNode> normNodes = Lists.newArrayListWithExpectedSize(2); normNodes.add(nodes.get(1)); normNodes.add(nodes.get(0)); nodes = normNodes; node = NODE_FACTORY.comparison(node.getInvertFilterOp(), nodes.get(0), nodes.get(1)); } return super.visitLeave(node, nodes); }
InListParseNode(List<ParseNode> children, boolean negate) { super(children); // All values in the IN must be constant. First child is the LHS for (int i = 1; i < children.size(); i++) { ParseNode child = children.get(i); if (!child.isStateless()) { throw new ParseException(new SQLExceptionInfo.Builder(SQLExceptionCode.VALUE_IN_LIST_NOT_CONSTANT) .build().buildException()); } } this.negate = negate; }
protected CountAggregateFunction getDelegateFunction(List<Expression> children, StatementContext context) { CountAggregateFunction countFunc = null; if (getChildren().get(0).isStateless()) { countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); } return countFunc; }
private void validateNodeIsStateless(CreateSequenceStatement sequence, ParseNode node, SQLExceptionCode code) throws SQLException { if (!node.isStateless()) { TableName sequenceName = sequence.getSequenceName(); throw SequenceUtil.getException(sequenceName.getSchemaName(), sequenceName.getTableName(), code); } }
for (int i = 0; i < splits.length; i++) { ParseNode node = splitNodes.get(i); if (!node.isStateless()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SPLIT_POINT_NOT_CONSTANT) .setMessage("Node: " + node).build().buildException();
CompoundParseNode(List<ParseNode> children) { this.children = Collections.unmodifiableList(children); boolean isStateless = true; for (ParseNode child : children) { isStateless &= child.isStateless(); if (!isStateless) { break; } } this.isStateless = isStateless; }
CompoundParseNode(List<ParseNode> children) { this.children = Collections.unmodifiableList(children); boolean isStateless = true; for (ParseNode child : children) { isStateless &= child.isStateless(); if (!isStateless) { break; } } this.isStateless = isStateless; }
private static int countConstants(List<ParseNode> nodes) { int count = 0; for (int i = 0; i < nodes.size(); i++) { if (nodes.get(i).isStateless()) { count++; } } return count; }
context.getBindManager().addParamMetaData((BindParseNode)node, expression); if (!node.isStateless()) { if (!selectVisitor.isAggregate() && statement.isAggregate()) { ExpressionCompiler.throwNonAggExpressionInAggException(expression.toString());
} else { whereNode = StatementNormalizer.normalize(whereNode, resolver); if (whereNode.isStateless()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.VIEW_WHERE_IS_CONSTANT) .build().buildException(); context.getBindManager().addParamMetaData((BindParseNode) node, VARBINARY_DATUM); if (node.isStateless()) { Expression expression = node.accept(expressionCompiler); if (expression.evaluate(null, ptr)) {;
@Override public ParseNode visitLeave(ComparisonParseNode node, List<ParseNode> nodes) throws SQLException { if (nodes.get(0).isStateless() && !nodes.get(1).isStateless() && !(nodes.get(1) instanceof ArrayElemRefNode)) { List<ParseNode> normNodes = Lists.newArrayListWithExpectedSize(2); normNodes.add(nodes.get(1)); normNodes.add(nodes.get(0)); nodes = normNodes; node = NODE_FACTORY.comparison(node.getInvertFilterOp(), nodes.get(0), nodes.get(1)); } return super.visitLeave(node, nodes); }
@Override public ParseNode visitLeave(ComparisonParseNode node, List<ParseNode> nodes) throws SQLException { if (nodes.get(0).isStateless() && !nodes.get(1).isStateless() && !(nodes.get(1) instanceof ArrayElemRefNode)) { List<ParseNode> normNodes = Lists.newArrayListWithExpectedSize(2); normNodes.add(nodes.get(1)); normNodes.add(nodes.get(0)); nodes = normNodes; node = NODE_FACTORY.comparison(node.getInvertFilterOp(), nodes.get(0), nodes.get(1)); } return super.visitLeave(node, nodes); }
if (!valueNode.isStateless()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.VALUE_IN_UPSERT_NOT_CONSTANT).build().buildException();
protected CountAggregateFunction getDelegateFunction(List<Expression> children, StatementContext context) { CountAggregateFunction countFunc = null; if (getChildren().get(0).isStateless()) { countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); } return countFunc; }
InListParseNode(List<ParseNode> children, boolean negate) { super(children); // All values in the IN must be constant. First child is the LHS for (int i = 1; i < children.size(); i++) { ParseNode child = children.get(i); if (!child.isStateless()) { throw new ParseException(new SQLExceptionInfo.Builder(SQLExceptionCode.VALUE_IN_LIST_NOT_CONSTANT) .build().buildException()); } } this.negate = negate; }
private void validateNodeIsStateless(CreateSequenceStatement sequence, ParseNode node, SQLExceptionCode code) throws SQLException { if (!node.isStateless()) { TableName sequenceName = sequence.getSequenceName(); throw SequenceUtil.getException(sequenceName.getSchemaName(), sequenceName.getTableName(), code); } }
private void validateNodeIsStateless(CreateSequenceStatement sequence, ParseNode node, SQLExceptionCode code) throws SQLException { if (!node.isStateless()) { TableName sequenceName = sequence.getSequenceName(); throw SequenceUtil.getException(sequenceName.getSchemaName(), sequenceName.getTableName(), code); } }
new SQLParser(this.getExpression()).parseExpression(); Expression defaultExpression = defaultParseNode.accept(compiler); if (!defaultParseNode.isStateless() || defaultExpression.getDeterminism() != Determinism.ALWAYS) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_CREATE_DEFAULT)