Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.UnsupportedSQLException


                    }
                }
                break;
            }
            if (clause == null)
                throw new UnsupportedSQLException("Unrecognized FULL_TEXT_SEARCH call",
                                                  condition.getSQLsource());
            if (query == null) {
                query = clause;
            }
            else {
                query = fullTextBoolean(Arrays.asList(query, clause),
                                        Arrays.asList(FullTextQueryBuilder.BooleanType.MUST,
                                                      FullTextQueryBuilder.BooleanType.MUST));
            }
        }
        if (query == null)
            return null;

        FullTextIndex foundIndex = null;
        TableSource foundTable = null;
        find_index:
        for (FullTextIndex index : textFields.get(0).getColumn().getColumn().getTable().getFullTextIndexes()) {
            TableSource indexTable = null;
            for (FullTextField textField : textFields) {
                Column column = textField.getColumn().getColumn();
                boolean found = false;
                for (IndexColumn indexColumn : index.getKeyColumns()) {
                    if (indexColumn.getColumn() == column) {
                        if (foundIndex == null) {
                            textField.setIndexColumn(indexColumn);
                        }
                        found = true;
                        if ((indexTable == null) &&
                            (indexColumn.getColumn().getTable() == index.getIndexedTable())) {
                            indexTable = (TableSource)textField.getColumn().getTable();
                        }
                        break;
                    }
                }
                if (!found) {
                    continue find_index;
                }
            }
            if (foundIndex == null) {
                foundIndex = index;
                foundTable = indexTable;
            }
            else {
                throw new UnsupportedSQLException("Ambiguous full text index: " +
                                                  foundIndex + " and " + index);
            }
        }
        if (foundIndex == null) {
            StringBuilder str = new StringBuilder("No full text index for: ");
            boolean first = true;
            for (FullTextField textField : textFields) {
                if (first)
                    first = false;
                else
                    str.append(", ");
                str.append(textField.getColumn());
            }
            throw new UnsupportedSQLException(str.toString());
        }
        if (foundTable == null) {
            for (TableGroupJoinNode node : tables) {
                if (node.getTable().getTable().getTable() == foundIndex.getIndexedTable()) {
                    foundTable = node.getTable();
View Full Code Here


                    return fullTextBoolean(Arrays.asList(inner),
                                           Arrays.asList(FullTextQueryBuilder.BooleanType.NOT));
            }
        }
        // TODO: LIKE
        throw new UnsupportedSQLException("Cannot convert to full text query" +
                                          condition);
    }
View Full Code Here

            if (aggregate.isDistinct()) {
                ExpressionNode other = aggregate.getOperand();
                if (operand == null)
                    operand = other;
                else if (!matchExpressionNode(operand, other))
                    throw new UnsupportedSQLException("More than one DISTINCT",
                                                      other.getSQLsource());
            }
            List<OrderByExpression> cur = aggregate.getOrderBy();
            if (ret == null)
                ret = cur;
            else if (cur != null && !cur.equals(ret))
                 throw new UnsupportedSQLException("Mix of ORDERY-BY ",
                                                   aggregate.getSQLsource());
        }
        if (operand == null)
            distinct = false;
        else
            for (AggregateFunctionExpression aggregate : source.getAggregates()) {
                if (!aggregate.isDistinct()) {
                    ExpressionNode other = aggregate.getOperand();
                    if (!matchExpressionNode(operand,other))
                        throw new UnsupportedSQLException("Mix of DISTINCT and non-DISTINCT",
                                                          operand.getSQLsource());
                    else if (!distinctDoesNotMatter(aggregate.getFunction()))
                        throw new UnsupportedSQLException("Mix of DISTINCT and non-DISTINCT",
                                                          other.getSQLsource());
                }
            }
      
        // both distinct and order-by are used, throw an error for now
        if (ret != null && distinct)
            throw new UnsupportedSQLException("Use of BOTH DISTINCT and ORDER-BY is not supported yet in" + source.getName());
        return new Object[]{distinct, ret};
    }
View Full Code Here

                                   columnContext, subqueryAssembler);
        }
        else if (node instanceof SubqueryExpression)
            return subqueryAssembler.assembleSubqueryExpression((SubqueryExpression)node);
        else if (node instanceof AggregateFunctionExpression)
            throw new UnsupportedSQLException("Aggregate used as regular function",
                    node.getSQLsource());
        else if (node instanceof ColumnDefaultExpression)
            return assembleColumnDefault(((ColumnDefaultExpression)node).getColumn(), null);
        else if (node instanceof IsNullIndexKey)
            return new TNullExpression(node.getType());
        else
            throw new UnsupportedSQLException("Unknown expression", node.getSQLsource());
    }
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.