Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.UnsupportedSQLException


    }

    public StorageDescription parseSQL(StorageFormatNode node, HasStorage forObject) {
        Format<?> format = formatsByIdentifier.get(node.getFormat());
        if (format == null) {
            throw new UnsupportedSQLException("", node);
        }
        return format.storageFormat.parseSQL(node, forObject);
    }
View Full Code Here


        // Right operand is whatever subquery selects.
        ValueNode rightOperand =
            selectNode.getResultColumns().get(0).getExpression();
       
        if (leftOperand instanceof ColumnReference && selectNode.getResultColumns().size() != 1) {
            throw new UnsupportedSQLException("Subquery must have one column");
        }
       
        boolean additionalEQ = false;
        switch (subqueryNode.getSubqueryType()) {
        case IN:
        case EQ_ANY:
            additionalEQ = true;
            break;
        }
        additionalEQ = additionalEQ && ((leftOperand instanceof ConstantNode) ||
                                        (leftOperand instanceof ColumnReference) ||
                                        (leftOperand instanceof ParameterNode));
       
        if (!isUniqueSubquery(selectNode, additionalEQ ? rightOperand : null))
            return result;

        // Yes, we can flatten it.
        currentSelectNode.getFromList().addAll(selectNode.getFromList());
        currentSelectNode.setWhereClause(mergeWhereClause(currentSelectNode.getWhereClause(),
                                                          selectNode.getWhereClause()));
        if (leftOperand == null) {
            ValueNode node = (ValueNode)nodeFactory.getNode(NodeTypes.BOOLEAN_CONSTANT_NODE, Boolean.TRUE, parserContext);
            node.setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID, false));
            return node;
        }

        int nodeType = 0;
        if (parentComparisonOperator != null)
            nodeType = parentComparisonOperator.getNodeType();
        else {
            switch (subqueryNode.getSubqueryType()) {
                // TODO: The ALL and NOT_IN cases aren't actually supported here yet.
            case IN:
            case EQ_ANY:
            case NOT_IN:
            case NE_ALL:
                nodeType = NodeTypes.BINARY_EQUALS_OPERATOR_NODE;
                break;

            case NE_ANY:
            case EQ_ALL:
                nodeType = NodeTypes.BINARY_NOT_EQUALS_OPERATOR_NODE;
                break;

            case LE_ANY:
            case GT_ALL:
                nodeType = NodeTypes.BINARY_LESS_EQUALS_OPERATOR_NODE;
                break;

            case LT_ANY:
            case GE_ALL:
                nodeType = NodeTypes.BINARY_LESS_THAN_OPERATOR_NODE;
                break;

            case GE_ANY:
            case LT_ALL:
                nodeType = NodeTypes.BINARY_GREATER_EQUALS_OPERATOR_NODE;
                break;

            case GT_ANY:
            case LE_ALL:
                nodeType = NodeTypes.BINARY_GREATER_THAN_OPERATOR_NODE;
                break;

            default:
                assert false;
            }
        }
        // when multiple columns in the leftOperand
        if (leftOperand instanceof RowConstructorNode) {
            RowConstructorNode rcn = (RowConstructorNode)leftOperand;
            if (rcn.listSize() != selectNode.getResultColumns().size()) {
                throw new UnsupportedSQLException("Subquery needs equal number of columns on left and right side of ... IN ... clause ");
            }
            ResultColumnList rcl = selectNode.getResultColumns();
            ValueNode leftO = null, rightO = null;
            // create branch of equivalent relations for the different columns, connected by AndNodes, and ending with a True Node
            for (int i = rcn.listSize()-1; i >= 0; i--) {
View Full Code Here

        this.name = execute.getName();
        paramValues = new ArrayList<>();
        for (ValueNode param : execute.getParameterList()) {
            TInstance type = null;
            if (!(param instanceof ConstantNode)) {
                throw new UnsupportedSQLException("EXECUTE arguments must be constants", param);
            }
            if (param.getType() != null)
                type = server.typesTranslator().typeForSQLType(param.getType());
            else
                type = server.typesTranslator().typeForString();
View Full Code Here

                deferConstraints(server,
                                 node.isAll(), node.getConstraints(), node.isDeferred());
            }
            break;
        default:
            throw new UnsupportedSQLException("session control", statement);
        }
    }
View Full Code Here

                RoutineDDL.dropRoutine(ddlFunctions, server.getRoutineLoader(), session, schema, (DropAliasNode)ddl, context);
                return;
            }
            break;
        }
        throw new UnsupportedSQLException(ddl.statementToString(), ddl);
    }
View Full Code Here

        if((alterTable.tableElementList != null) && !alterTable.tableElementList.isEmpty()) {
            level = processAlter(ddlFunctions, session, defaultSchemaName, table, alterTable.tableElementList, context);
        }

        if(level == null) {
            throw new UnsupportedSQLException (alterTable.statementToString(), alterTable);
        }
        return level;
    }
View Full Code Here

                } break;

                case NodeTypes.INDEX_DEFINITION_NODE:
                    IndexDefinitionNode idn = (IndexDefinitionNode)node;
                    if(idn.getJoinType() != null) {
                        throw new UnsupportedSQLException("ALTER ADD INDEX containing group index");
                    }
                    indexDefNodes.add(idn);
                    break;
                   
                case NodeTypes.AT_DROP_INDEX_NODE: {
View Full Code Here

                            TableName name = tableCopy.getName();
                            TableDDL.setAutoIncrement(builder, name.getSchemaName(), name.getTableName(), modNode);
                        }
                        break;
                        case ColumnDefinitionNode.MODIFY_AUTOINCREMENT_INC_VALUE:
                            throw new UnsupportedSQLException("SET INCREMENT BY", modNode);
                        case ColumnDefinitionNode.MODIFY_AUTOINCREMENT_RESTART_VALUE:
                            // Note: Also handled above
                            throw new UnsupportedSQLException("RESTART WITH", modNode);
                        default:
                            throw new IllegalStateException("Unknown autoIncType: " + autoIncType);
                    }
                } else {
                    // DROP DEFAULT will come though as a NULL default, clears both GENERATED and DEFAULT
View Full Code Here

                    else if (sqlArg instanceof ParameterNode) {
                        parameterArgs[i] = ((ParameterNode)sqlArg).getParameterNumber();
                        continue;
                    }
                }
                throw new UnsupportedSQLException("CALL parameter must be constant",
                                                  marg);
            }
        }
        return new ServerCallInvocation(routine, constantArgs, parameterArgs);
    }
View Full Code Here

    }

    @Override
    protected void doEvaluate(TExecutionContext context, LazyList<? extends ValueSource> inputs, ValueTarget output)
    {
            throw new UnsupportedSQLException("This query is not supported, its definition " +
                                              "is used solely for optimization purposes.");
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.error.UnsupportedSQLException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.