Examples of SQLBulkRequest


Examples of io.crate.action.sql.SQLBulkRequest

            String id = (String)object[0];
            Id esId = new Id(ImmutableList.of(new ColumnIdent("id")), ImmutableList.of(new BytesRef(id)), new ColumnIdent("id"), true);
            ids.put(id, esId.stringValue());
        }
        SQLBulkRequest request = new SQLBulkRequest(SINGLE_INSERT_SQL_STMT, bulkArgs);
        client().execute(SQLBulkAction.INSTANCE, request).actionGet();
        refresh(client());
        return ids;
    }
View Full Code Here

Examples of io.crate.action.sql.SQLBulkRequest

        int i = 0;
        for(String id: ids.keySet()){
            bulkArgs[i] = new Object[]{id};
            i++;
        }
        getClient(false).execute(SQLBulkAction.INSTANCE, new SQLBulkRequest(DELETE_SQL_STMT, bulkArgs)).actionGet();
        refresh(client());
    }
View Full Code Here

Examples of io.crate.action.sql.SQLBulkRequest

        client.sql("create table test (a string, b int) with (number_of_replicas=0)").actionGet();
        ensureGreen();
        client.sql("insert into test (a, b) values ('foo', 1)").actionGet();
        client.sql("refresh table test").actionGet();

        SQLBulkRequest bulkRequest = new SQLBulkRequest(
                "update test set a = ? where b = ?",
                new Object[][]{new Object[]{"bar", 1}, new Object[]{"baz", 1}});
        SQLBulkResponse bulkResponse = client.bulkSql(bulkRequest).actionGet();
        assertThat(bulkResponse.results().length, is(2));
        for (SQLBulkResponse.Result result : bulkResponse.results()) {
View Full Code Here

Examples of io.crate.action.sql.SQLBulkRequest

                        new Object[]{2, "Trillian"}
                });
    }

    private void assertBulkResponseWithTypes(String stmt, Object[][] bulkArgs) {
        SQLBulkRequest request = new SQLBulkRequest(stmt, bulkArgs);
        request.includeTypesOnResponse(true);
        SQLBulkResponse sqlResponse = sqlExecutor.exec(request);
        assertThat(sqlResponse.columnTypes(), is(notNullValue()));
        assertThat(sqlResponse.columnTypes().length, is(sqlResponse.cols().length));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.