Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.NoSuchTableException


        Map<?,?> map = (Map<?,?>)obj;
        TableName tableName = TableName.create(defaultSchema,
                                               (String)map.get(TABLE_NAME_KEY));
        Table table = ais.getTable(tableName);
        if (table == null)
            throw new NoSuchTableException(tableName);
        String indexName = (String)map.get(INDEX_NAME_KEY);
        Index index = table.getIndex(indexName);
        if (index == null) {
            index = table.getGroup().getIndex(indexName);
            if (index == null) {
View Full Code Here


    private Table getTable(AkibanInformationSchema ais, String schemaName, String tableName) {
        Table table = ais.getTable(schemaName, tableName);
        if (table == null) {
            // TODO: Consider sending in-band as JSON.
            throw new NoSuchTableException(schemaName, tableName);
        }
        return table;
    }
View Full Code Here

            parts[0] = context.getCurrentSchema();
        }
        AkibanInformationSchema ais = context.getQueryContext().getStore().schema().ais();
        Table table = ais.getTable(parts[0], parts[1]);
        if(table == null) {
            throw new NoSuchTableException(parts[0], parts[1]);
        }
        Column column = table.getColumn(parts[2]);
        if(column == null) {
            throw new NoSuchColumnException(String.format("%s.%s.%s", parts[0], parts[1], parts[2]));
        }
View Full Code Here

        protected TableNode getTargetTable(DMLModStatementNode statement)
                throws StandardException {
            TableName tableName = statement.getTargetTableName();
            Table table = (Table)tableName.getUserData();
            if (table == null)
                throw new NoSuchTableException(tableName.getSchemaName(),
                                               tableName.getTableName());
            if (table.isAISTable()) {
                throw new ProtectedTableDDLException (table.getName());
            }
            return getTableNode(table);
View Full Code Here

        String tableName = copyStmt.getTableName().getTableName();
        if (schemaName == null)
            schemaName = server.getDefaultSchemaName();
        toTable = server.getAIS().getTable(schemaName, tableName);
        if (toTable == null)
            throw new NoSuchTableException(schemaName, tableName,
                                           copyStmt.getTableName());
        if (copyStmt.getColumnList() == null)
            toColumns = toTable.getColumns();
        else {
            toColumns = new ArrayList<>(copyStmt.getColumnList().size());
View Full Code Here

            case TABLE:
            {
                final TableName tableName = new TableName(indexName.getSchemaName(), indexName.getTableName());
                final Table newTable = targetAIS.getTable(tableName);
                if(newTable == null) {
                    throw new NoSuchTableException(tableName);
                }
                curIndex = newTable.getIndex(indexName.getName());
                newGroup = newTable.getGroup();
                Integer newId = newIndexID(newGroup);
                newIndex = TableIndex.create(targetAIS, newTable, indexName.getName(), newId, index.isUnique(),
                                             index.isPrimaryKey(), index.getConstraintName());
            }
            break;
            case GROUP:
            {
                GroupIndex gi = (GroupIndex)index;
                newGroup = targetAIS.getGroup(gi.getGroup().getName());
                if(newGroup == null) {
                    throw new NoSuchGroupException(gi.getGroup().getName());
                }
                curIndex = newGroup.getIndex(indexName.getName());
                Integer newId = newIndexID(newGroup);
                newIndex = GroupIndex.create(targetAIS, newGroup, indexName.getName(), newId, index.isUnique(),
                                             index.isPrimaryKey(), index.getJoinType());
            }
            break;
            case FULL_TEXT:
            {
                final TableName tableName = new TableName(indexName.getSchemaName(), indexName.getTableName());
                final Table newTable = targetAIS.getTable(tableName);
                if(newTable == null) {
                    throw new NoSuchTableException(tableName);
                }
                curIndex = newTable.getFullTextIndex(indexName.getName());
                newGroup = newTable.getGroup();
                Integer newId = newIndexID(newGroup);
                newIndex = FullTextIndex.create(targetAIS, newTable, indexName.getName(), newId);
            }
            break;
            default:
                throw new IllegalArgumentException("Unknown index type: " + index);
        }

        if(index.getIndexMethod() == Index.IndexMethod.Z_ORDER_LAT_LON) {
            newIndex.markSpatial(index.firstSpatialArgument(),
                                 index.lastSpatialArgument() - index.firstSpatialArgument() + 1);
        }

        if(curIndex != null) {
            throw new DuplicateIndexException(indexName);
        }
        if(index.getKeyColumns().isEmpty()) {
            throw new IndexLacksColumnsException(indexName);
        }

        for(IndexColumn indexCol : index.getKeyColumns()) {
            final TableName refTableName = indexCol.getColumn().getTable().getName();
            final Table newRefTable = targetAIS.getTable(refTableName);
            if(newRefTable == null) {
                throw new NoSuchTableException(refTableName);
            }
            if(!newRefTable.getGroup().equals(newGroup)) {
                throw new TableNotInGroupException(refTableName);
            }
View Full Code Here

                schemaName = value.getString();
            tableName = bindings.getValue(1).getString();
            rootTable = context.getStore().schema().ais()
                .getTable(schemaName, tableName);
            if (rootTable == null)
                throw new NoSuchTableException(schemaName, tableName);
            int commitFrequency;
            value = valueNotNull(3);
            if (value != null)
                commitFrequency = value.getInt32();
            else if (context.getTransactionPeriodicallyCommit() != ServerTransaction.PeriodicallyCommit.OFF)
View Full Code Here

        @Override
        public ChangeLevel alterTable(Session session, TableName tableName, Table newDefinition,
                                      List<TableChange> columnChanges, List<TableChange> indexChanges, QueryContext context) {
            if(ais.getTable(tableName) == null) {
                throw new NoSuchTableException(tableName);
            }
            ais.getTables().remove(tableName);
            ais.getTables().put(newDefinition.getName(), newDefinition);
            for(TableChange change : columnChanges) {
                columnChangeDesc.add(change.toString());
View Full Code Here

TOP

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

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.