CREATE TABLE
454455456457458459460461462463464465466
private static CFMetaData compile(String cql, String keyspace) { try { CreateTableStatement statement = (CreateTableStatement) QueryProcessor.parseStatement(cql).prepare().statement; CFMetaData cfm = newSystemMetadata(keyspace, statement.columnFamily(), "", statement.comparator, null); statement.applyPropertiesTo(cfm); return cfm.rebuild(); } catch (RequestValidationException e) { throw new RuntimeException(e);
202203204205206207208209210211212213
{ try { CFStatement parsed = (CFStatement)QueryProcessor.parseStatement(cql); parsed.prepareKeyspace(AUTH_KS); CreateTableStatement statement = (CreateTableStatement) parsed.prepare().statement; CFMetaData cfm = statement.getCFMetaData().copy(CFMetaData.generateLegacyCfId(AUTH_KS, name)); assert cfm.cfName.equals(name); MigrationManager.announceNewColumnFamily(cfm); } catch (Exception e) {
546547548549550551552553554555556557558
{ try { CFStatement parsed = (CFStatement)QueryProcessor.parseStatement(cql); parsed.prepareKeyspace(keyspace); CreateTableStatement statement = (CreateTableStatement) parsed.prepare().statement; CFMetaData cfm = newSystemMetadata(keyspace, statement.columnFamily(), "", statement.comparator); statement.applyPropertiesTo(cfm); return cfm.rebuild(); } catch (RequestValidationException e) { throw new RuntimeException(e);
540541542543544545546547548549550551552
479480481482483484485486487488489490491
@VisibleForTesting public static CFMetaData compile(String cql, String keyspace) { try { CreateTableStatement statement = (CreateTableStatement) QueryProcessor.parseStatement(cql).prepare().statement; CFMetaData cfm = newSystemMetadata(keyspace, statement.columnFamily(), "", statement.comparator, null); statement.applyPropertiesTo(cfm); return cfm.rebuild(); } catch (RequestValidationException e) { throw new RuntimeException(e);
572573574575576577578579580581582583584
{ try { CFStatement parsed = (CFStatement)QueryProcessor.parseStatement(cql); parsed.prepareKeyspace(AUTH_KS); CreateTableStatement statement = (CreateTableStatement) parsed.prepare().statement; CFMetaData cfm = statement.getCFMetaData().clone(CFMetaData.generateLegacyCfId(AUTH_KS, name)); assert cfm.cfName.equals(name); MigrationManager.announceNewColumnFamily(cfm); } catch (Exception e) {
547548549550551552553554555556557558559