Search in sources :

Example 1 with BlobTableInfo

use of io.crate.metadata.blob.BlobTableInfo in project crate by crate.

the class AlterBlobTableAnalyzer method analyze.

public AlterBlobTableAnalyzedStatement analyze(AlterBlobTable node, Row parameters) {
    TableIdent tableIdent = tableToIdent(node.table());
    assert BlobSchemaInfo.NAME.equals(tableIdent.schema()) : "schema name must be 'blob'";
    BlobTableInfo tableInfo = (BlobTableInfo) schemas.getTableInfo(tableIdent);
    TableParameter tableParameter = new TableParameter();
    if (node.genericProperties().isPresent()) {
        TablePropertiesAnalyzer.analyze(tableParameter, tableInfo.tableParameterInfo(), node.genericProperties(), parameters);
    } else if (!node.resetProperties().isEmpty()) {
        TablePropertiesAnalyzer.analyze(tableParameter, tableInfo.tableParameterInfo(), node.resetProperties());
    }
    return new AlterBlobTableAnalyzedStatement(tableInfo, tableParameter);
}
Also used : BlobTableInfo(io.crate.metadata.blob.BlobTableInfo) TableIdent(io.crate.metadata.TableIdent)

Example 2 with BlobTableInfo

use of io.crate.metadata.blob.BlobTableInfo in project crate by crate.

the class DropBlobTableAnalyzer method analyze.

public DropBlobTableAnalyzedStatement analyze(DropBlobTable node) {
    TableIdent tableIdent = tableToIdent(node.table());
    BlobTableInfo tableInfo = null;
    boolean isNoop = false;
    try {
        tableInfo = (BlobTableInfo) schemas.getTableInfo(tableIdent);
    } catch (ResourceUnknownException e) {
        if (node.ignoreNonExistentTable()) {
            isNoop = true;
        } else {
            throw e;
        }
    }
    return new DropBlobTableAnalyzedStatement(tableInfo, isNoop, node.ignoreNonExistentTable());
}
Also used : BlobTableInfo(io.crate.metadata.blob.BlobTableInfo) TableIdent(io.crate.metadata.TableIdent) ResourceUnknownException(io.crate.exceptions.ResourceUnknownException)

Aggregations

TableIdent (io.crate.metadata.TableIdent)2 BlobTableInfo (io.crate.metadata.blob.BlobTableInfo)2 ResourceUnknownException (io.crate.exceptions.ResourceUnknownException)1