Java Client connector

I was trying to connect using the Java client 0.6.0 . Received the below error .

Exception in thread “main” io.grpc.StatusRuntimeException: INVALID_ARGUMENT: The ‘queries’ parameter has been deprecated.
at io.grpc.stub.ClientCalls.toStatusRuntimeException(
at io.grpc.stub.ClientCalls.getUnchecked(
at io.grpc.stub.ClientCalls.blockingUnaryCall(
at io.pinecone.proto.VectorServiceGrpc$VectorServiceBlockingStub.query(
at org.example.PineConeConnector.main(

I use the below code to connect to pinecode database .

try (PineconeConnection connection = pineconeClient.connect(connectionConfig)) {
Vector v1 = Vector.newBuilder()
.addAllValues(Floats.asList(1F, 3F, 5F))

        Vector v2 = Vector.newBuilder()
                .addAllValues(Floats.asList(5F, 3F, 1F))

        // Deprecated: use addValue() or addAllValues() instead of addVector() and addAllVectors() respectively
        UpsertRequest upsertRequest = UpsertRequest.newBuilder()

        System.out.println("Sending upsert request:");

        UpsertResponse upsertResponse = connection.getBlockingStub().upsert(upsertRequest);

        System.out.println("Got upsert response:");

        QueryVector queryVector = QueryVector
                .addAllValues(Floats.asList(1F, 2F, 2F))

        QueryRequest queryRequest = QueryRequest

        System.out.println("Sending query request:");

        QueryResponse queryResponse = connection.getBlockingStub().query(queryRequest);

        System.out.println("Got query response:");
    } catch (PineconeException e) {

Hi The queries parameter was deprecated some time ago; to run a query using the Java client, you now want to use a list instead of the QueryBuilder object. You can see an example of how to do this in this forum post from one of our Java engineers.

We have some improvements coming out soon that should simplify this, too. Please keep an eye on our release announcements, or the Github repo for the client.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.