CREATE TABLE
247248249250251252253254255256257258
{ 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) {
291292293294295296297298299300301302303
{ 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);
459460461462463464465466467468469470471
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);
490491492493494495496497498499500501502
@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);
455456457458459460461462463464465466467
538539540541542543544545546547548549550
478479480481482483484485486487488489490
457458459460461462463464465466467468469
481482483484485486487488489490491492493