Add a keyspace
@param statement - a token tree representing current statement
487966
private void executeAddKeySpace(Tree statement)
    {

        if (!CliMain.isConnected())
            return;

        // first value is the keyspace name, after that it is all key=value
        String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
        KsDef ksDef = new KsDef(keyspaceName, DEFAULT_PLACEMENT_STRATEGY, new LinkedList<CfDef>());

        try
        {
            String mySchemaVersion = thriftClient.system_add_keyspace(updateKsDefAttributes(statement, ksDef));
            sessionState.out.println(mySchemaVersion);

            keyspacesMap.put(keyspaceName, thriftClient.describe_keyspace(keyspaceName));
        }
        catch (InvalidRequestException e)
        {
            throw new RuntimeException(e);
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
    }
209449
public void appendCSSDefinition(StringBuilder buf) {
    buf.append("\n.");
    buf.append(name);
    buf.append('{');
    for (Pair<String, String> pair : statements) {
      buf.append(pair.getFirst());
      buf.append(':');
      buf.append(pair.getSecond());
      buf.append(";\n");
    }
    buf.append("}\n");
  }
1018019
private void executeStatement(String statement) throws SQLException {

        Statement stmt = null;

        try {
            stmt = m_con.createStatement();
            stmt.execute(statement);
        } finally {
            if (stmt != null) {
                stmt.close();
            }
        }
    }
528481
function (out, statement) {
                    var parsename = /^@(\w+):(\w+)$/.exec(statement.name);
                    if (!parsename || parsename.length != 3) {
                        return out.logError(statement, statementsSingleton.INVALID_WIDGET_SYNTAX);
                    }
                    var libName = parsename[1];
                    var widgetName = parsename[2];
                    var libclasspath = out.templateParam.$wlibs[libName];
                    if (libclasspath === undefined) {
                        return out.logError(statement, statementsSingleton.UNDECLARED_WIDGET_LIBRARY, [libName]);
                    }
                    if (!out.dontLoadWidgetLibs) {
                        var wlib = out.wlibs[libName];
                        if (!wlib) {
                            wlib = Aria.getClassRef(libclasspath);
                            if (!ariaUtilsType.isInstanceOf(wlib, "aria.widgetLibs.WidgetLib")) {
                                return out.logError(statement, statementsSingleton.INVALID_WIDGET_LIBRARY, [libName,
                                        libclasspath]);
                            }
                            out.wlibs[libName] = wlib;
                        }
                        var dep = wlib.getWidgetDependencies(widgetName, out.allDependencies);
                        if (!dep) {
                            return out.logError(statement, statementsSingleton.UNKNOWN_WIDGET, [statement.name]);
                        }
                        out.addDependencies(dep);
                    }
                    var param = statement.paramBlock;
                    if (param.length === 0) {
                        param = "undefined";
                    } else {
                        // Look for use of standard binding transforms
                        // and automatically add those to dependencies
                        var transformDependencies = [];
                        var regEx = /[\'\"](aria\.widgets\.transform\.(.+))[\'\"]/g;
                        var myMatch = regEx.exec(param);
                        while (myMatch) {
                            transformDependencies.push(myMatch[1]);
                            myMatch = regEx.exec(param);
                        }
                        out.addDependencies(transformDependencies);
                    }

                    if (out.debug && param != "undefined") {
                        param = out.wrapExpression(param, statement, "this.EXCEPTION_IN_CONTROL_PARAMETERS");
                    }

                    if (statement.content) {
                        // container widget
                        out.writeln("if (this.__$beginContainerWidget(", out.stringify(libclasspath), ",", out.stringify(widgetName), ",(", param, "),", statement.lineNumber, ")) {");
                        out.increaseIndent();
                        out.processContent(statement.content);
                        out.writeln("this.__$endContainerWidget();");
                        out.decreaseIndent();
                        out.writeln("}");
                    } else {
                        // simple widget
                        out.writeln("this.__$processWidgetMarkup(", out.stringify(libclasspath), ",", out.stringify(widgetName), ",(", param, "),", statement.lineNumber, ");");
                    }
                    statement.properties = {
                        libName: libName,
                        libClasspath: libclasspath,
                        widgetName: widgetName
                    };
                }
281032
def add_statement(self, statement_obj):
        
        if statement_obj.get_id() in self.idx:
            raise ValueError("Statement with id {} already exists!"
                             .format(statement_obj.get_id()))
        self.node.append(statement_obj.get_node())
        self.idx[statement_obj.get_id()] = statement_obj
333740
@PUT
	@Path("/{keyspace}/{columnFamily}/{key}/{columnName}")
	@Produces({ "application/json" })
	public void addColumn(@PathParam("keyspace") String keyspace, @PathParam("columnFamily") String columnFamily,
			@PathParam("key") String key, @PathParam("columnName") String columnName,
			@QueryParam("index") boolean index, String body,
			@HeaderParam(CONSISTENCY_LEVEL_HEADER) String consistencyLevel) throws Exception {
		if (logger.isDebugEnabled())
			logger.debug("Deleting row [" + keyspace + "]:[" + columnFamily + "]:[" + key + "] => [" + body + "]");
		getCassandraStorage().addColumn(keyspace, columnFamily, key, columnName, body,
				config.getConsistencyLevel(consistencyLevel), index);
	}
447584
void executeStatement(String statement) {

		try (Connection conn = getFastConnection(); Statement stm = conn.createStatement()) {
			stm.execute(statement);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

	}
1167667
def add_statement(key, obj)
      if obj.is_a?(RDF::Statement)
        @source[normalize_key(key)] = obj 
        local_repository << obj
      end
    end
1306299
void addBasic(Token token) {
    if (basicStart == -1) {
      basicStart = buffer.length();
      basicStartOfWhitespace = -1;
      basicHasNewline = false;
    }
    switch (token.kind) {
      case SoyFileParserConstants.TOKEN_WS:
        if (token.image.indexOf('\r') != -1 || token.image.indexOf('\n') != -1) {
          basicHasNewline = true;
        }
        if (basicStartOfWhitespace == -1 && whitespaceMode == WhitespaceMode.JOIN) {
          basicStartOfWhitespace = buffer.length();
          endLineAtStartOfWhitespace = offsets.endLine();
          endColumnAtStartOfWhitespace = offsets.endColumn();
        }
        break;
      case SoyFileParserConstants.TOKEN_NOT_WS:
        maybeCollapseWhitespace(token.image);
        break;
      default:
        throw new AssertionError(
            SoyFileParserConstants.tokenImage[token.kind] + " is not a basic text token");
    }
    append(token, token.image);
  }
396270
public void dropKeyspace() {
        String cqlKeyspace = m_dbservice.getKeyspace();
        m_logger.info("Dropping keyspace: {}", cqlKeyspace);
        StringBuilder cql = new StringBuilder();
        cql.append("DROP KEYSPACE ");
        cql.append(cqlKeyspace);
        cql.append(";");
        executeCQL(cql.toString());
    }
1189940
@NonNull
  public BatchStatementBuilder addStatements(@NonNull BatchableStatement<?>... statements) {
    return addStatements(Arrays.asList(statements));
  }
1062910
private void addUniqueConstraintForTableBasedSequence(Statements statements, IdSourceKeyMetadata generatorKeyMetadata) {
		Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColumnName(), generatorKeyMetadata.getName() );
		statements.addStatement( statement );
	}
400083
def add(self, statement, parameters=None):
        
        if isinstance(statement, six.string_types):
            if parameters:
                encoder = Encoder() if self._session is None else self._session.encoder
                statement = bind_params(statement, parameters, encoder)
            self._add_statement_and_params(False, statement, ())
        elif isinstance(statement, PreparedStatement):
            query_id = statement.query_id
            bound_statement = statement.bind(() if parameters is None else parameters)
            self._update_state(bound_statement)
            self._add_statement_and_params(True, query_id, bound_statement.values)
        elif isinstance(statement, BoundStatement):
            if parameters:
                raise ValueError(
                    "Parameters cannot be passed with a BoundStatement "
                    "to BatchStatement.add()")
            self._update_state(statement)
            self._add_statement_and_params(True, statement.prepared_statement.query_id, statement.values)
        else:
            # it must be a SimpleStatement
            query_string = statement.query_string
            if parameters:
                encoder = Encoder() if self._session is None else self._session.encoder
                query_string = bind_params(query_string, parameters, encoder)
            self._update_state(statement)
            self._add_statement_and_params(False, query_string, ())
        return self
840916
function validateStatement(node, keywordName) {
            const option = getOption(keywordName);

            if (node.type === "BlockStatement" || option === "any") {
                return;
            }

            const tokenBefore = sourceCode.getTokenBefore(node);

            if (tokenBefore.loc.end.line === node.loc.start.line && option === "below") {
                context.report({
                    node,
                    message: "Expected a linebreak before this statement.",
                    fix: fixer => fixer.insertTextBefore(node, "\n")
                });
            } else if (tokenBefore.loc.end.line !== node.loc.start.line && option === "beside") {
                context.report({
                    node,
                    message: "Expected no linebreak before this statement.",
                    fix(fixer) {
                        if (sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim()) {
                            return null;
                        }
                        return fixer.replaceTextRange([tokenBefore.range[1], node.range[0]], " ");
                    }
                });
            }
        }
244719
public void execute(String statement) throws SQLException {
		if (logger.isDebugEnabled()) {
			logger.debug("Executing SQL statement [" + statement + "]");
		}
		
		Connection connection = null;
		Statement stm = null;
		
		try{
			connection = ds.getConnection();
			stm = connection.createStatement();			
			stm.execute(statement);
		} catch (SQLException e) {
			throw e;
		}finally{
			if(stm!=null) stm.close();
			if(connection!=null) connection.close();			
		}
				
	}
576130
static String getSQL(Token[] statement) {

        boolean      wasDelimiter = true;
        StringBuffer sb           = new StringBuffer();

        for (int i = 0; i < statement.length; i++) {
            // when the previous statement is ')', there should be a blank before the non-delimiter statement.
            if (!statement[i].isDelimiter &&
                    (!wasDelimiter
                            || (i > 0 && ")".equals(statement[i - 1].getSQL()))))
            {
                sb.append(' ');
            }

            sb.append(statement[i].getSQL());

            wasDelimiter = statement[i].isDelimiter;
        }

        return sb.toString();
    }
1064186
private void executeGet(Tree statement)
            throws TException, NotFoundException, InvalidRequestException, UnavailableException, TimedOutException
    {
        if (!CliMain.isConnected() || !hasKeySpace())
            return;
        long startTime = System.nanoTime();
        Tree columnFamilySpec = statement.getChild(0);
        String columnFamily = CliCompiler.getColumnFamily(columnFamilySpec, currentCfDefs());
        ByteBuffer key = getKeyAsBytes(columnFamily, columnFamilySpec.getChild(1));
        int columnSpecCnt = CliCompiler.numColumnSpecifiers(columnFamilySpec);
        CfDef cfDef = getCfDef(columnFamily);
        boolean isSuper = cfDef.column_type.equals("Super");

        byte[] superColumnName = null;
        ByteBuffer columnName;

        Tree typeTree = null;
        Tree limitTree = null;

        int limit = 1000000;

        if (statement.getChildCount() >= 2)
        {
            if (statement.getChild(1).getType() == CliParser.CONVERT_TO_TYPE)
            {
                typeTree = statement.getChild(1).getChild(0);
                if (statement.getChildCount() == 3)
                    limitTree = statement.getChild(2).getChild(0);
            }
            else
            {
                limitTree = statement.getChild(1).getChild(0);
            }
        }

        if (limitTree != null)
        {
            limit = Integer.parseInt(limitTree.getText());

            if (limit == 0)
            {
                throw new IllegalArgumentException("LIMIT should be greater than zero.");
            }
        }

        // keyspace.cf['key'] -- row slice
        if (columnSpecCnt == 0)
        {
            doSlice(keySpace, key, columnFamily, superColumnName, limit);
            return;
        }
        // keyspace.cf['key']['column'] -- slice of a super, or get of a standard
        else if (columnSpecCnt == 1)
        {
            columnName = getColumnName(columnFamily, columnFamilySpec.getChild(2));

            if (isSuper)
            {
                superColumnName = columnName.array();
                doSlice(keySpace, key, columnFamily, superColumnName, limit);
                return;
            }
        }
        // keyspace.cf['key']['column']['column'] -- get of a sub-column
        else if (columnSpecCnt == 2)
        {
            superColumnName = getColumnName(columnFamily, columnFamilySpec.getChild(2)).array();
            columnName = getSubColumnName(columnFamily, columnFamilySpec.getChild(3));
        }
        // The parser groks an arbitrary number of these so it is possible to get here.
        else
        {
            sessionState.out.println("Invalid row, super column, or column specification.");
            return;
        }

        AbstractType<?> validator = getValidatorForValue(cfDef, TBaseHelper.byteBufferToByteArray(columnName));

        // Perform a get()
        ColumnPath path = new ColumnPath(columnFamily);
        if(superColumnName != null) path.setSuper_column(superColumnName);
        path.setColumn(columnName);

        if (isCounterCF(cfDef))
        {
            doGetCounter(key, path);
            elapsedTime(startTime);
            return;
        }

        Column column;
        try
        {
            column = thriftClient.get(key, path, consistencyLevel).column;
        }
        catch (NotFoundException e)
        {
            sessionState.out.println("Value was not found");
            elapsedTime(startTime);
            return;
        }

        byte[] columnValue = column.getValue();
        String valueAsString;

        // we have ^(CONVERT_TO_TYPE <type>) inside of GET statement
        // which means that we should try to represent byte[] value according
        // to specified type
        if (typeTree != null)
        {
            // .getText() will give us <type>
            String typeName = CliUtils.unescapeSQLString(typeTree.getText());
            // building AbstractType from <type>
            AbstractType<?> valueValidator = getFormatType(typeName);

            // setting value for output
            valueAsString = valueValidator.getString(ByteBuffer.wrap(columnValue));
            // updating column value validator class
            updateColumnMetaData(cfDef, columnName, valueValidator.toString());
        }
        else
        {
            valueAsString = (validator == null) ? new String(columnValue, StandardCharsets.UTF_8) : validator.getString(ByteBuffer.wrap(columnValue));
        }

        String formattedColumnName = isSuper
                                     ? formatSubcolumnName(keySpace, columnFamily, column.name)
                                     : formatColumnName(keySpace, columnFamily, column.name);

        // print results
        sessionState.out.printf("=> (name=%s, value=%s, timestamp=%d%s)%n",
                                formattedColumnName,
                                valueAsString,
                                column.timestamp,
                                column.isSetTtl() ? String.format(", ttl=%d", column.getTtl()) : "");
        elapsedTime(startTime);
    }