From b6686ab955384bded2c4646993f2e00c10518c54 Mon Sep 17 00:00:00 2001 From: Mark Wolters Date: Thu, 1 Jun 2023 14:35:50 +0000 Subject: [PATCH 1/7] fixed top_k spelling, added test for multiple vector query --- .../PineconeQueryOpDispenser.java | 2 +- .../activities/pinecone-query-multiple.yaml | 27 +++++++++++++++++++ .../resources/activities/pinecone-query.yaml | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java index 68c2d5108..3c7412c1d 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java @@ -77,7 +77,7 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { rFunc = l -> finalFunc.apply(l).setNamespace(af.apply(l)); } - Optional> tFunc = op.getAsOptionalFunction("topk", Integer.class); + Optional> tFunc = op.getAsOptionalFunction("top_k", Integer.class); if (tFunc.isPresent()) { LongFunction finalFunc = rFunc; LongFunction af = tFunc.get(); diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml new file mode 100644 index 000000000..185deab5b --- /dev/null +++ b/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml @@ -0,0 +1,27 @@ +scenarios: + default: + query: run driver=pinecone tags==blocks:query cycles=10 + +blocks: + query: + ops: + op1: + query: "test-index" + top_k: 3 + query_vectors: + - id: "1" + values: "0.8602578079921012,0.12103044768221516,0.7737329191858439,0.4521093269320254,0.29351661477669416,0.4261807015226558,0.14131665592103335,0.882370813029422,0.4412833140430886,0.9916525700115515" + namespace: "example_namespace" + top_k: 3 + filter: + filterfield: "category" + operator: "$eq" + comparator: "movies" + - id: "2" + values: "0.8602578079921012,0.12103044768221516,0.7737329191858439,0.4521093269320254,0.29351661477669416,0.4261807015226558,0.14131665592103335,0.882370813029422,0.4412833140430886,0.9916525700115515" + namespace: "example_namespace" + top_k: 3 + filter: + filterfield: "category" + operator: "$eq" + comparator: "sports" diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-query.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-query.yaml index a4a42149b..b76462818 100644 --- a/adapter-pinecone/src/main/resources/activities/pinecone-query.yaml +++ b/adapter-pinecone/src/main/resources/activities/pinecone-query.yaml @@ -9,7 +9,7 @@ blocks: query: "test-index" vector: "0.8602578079921012,0.12103044768221516,0.7737329191858439,0.4521093269320254,0.29351661477669416,0.4261807015226558,0.14131665592103335,0.882370813029422,0.4412833140430886,0.9916525700115515" namespace: "example_namespace" - topk: 10 + top_k: 10 include_values: true include_metadata: true filter: From b0830dc192afeb917da0ea9b4d17d034ffdb1319 Mon Sep 17 00:00:00 2001 From: Mark Wolters Date: Thu, 1 Jun 2023 14:58:24 +0000 Subject: [PATCH 2/7] added test for list type in filters --- .../src/main/resources/activities/pinecone-stats.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-stats.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-stats.yaml index cb18e951b..b4efc21e0 100644 --- a/adapter-pinecone/src/main/resources/activities/pinecone-stats.yaml +++ b/adapter-pinecone/src/main/resources/activities/pinecone-stats.yaml @@ -7,4 +7,10 @@ blocks: ops: op1: describeindexstats: "test-index" - #filter: "" + filter: + filterfield: "colors" + operator: "$in" + comparator: + - "blue" + - "red" + - "green" From 0f0784b9a75eb15c4248393aa6e15b493c5cea71 Mon Sep 17 00:00:00 2001 From: Mark Wolters Date: Thu, 1 Jun 2023 17:42:08 +0000 Subject: [PATCH 3/7] code cleanup --- .../adapter/pinecone/PineconeOpMapper.java | 2 +- .../PineconeDeleteOpDispenser.java | 2 -- ...PineconeDescribeIndexStatsOpDispenser.java | 3 +-- .../PineconeFetchOpDispenser.java | 2 +- .../opdispensers/PineconeOpDispenser.java | 11 ++++++++++ .../PineconeQueryOpDispenser.java | 17 +++++---------- .../PineconeUpdateOpDispenser.java | 21 +++++++------------ .../PineconeUpsertOpDispenser.java | 12 +++++------ .../pinecone/ops/PineconeDeleteOp.java | 5 ++--- .../pinecone/ops/PineconeUpdateOp.java | 2 +- 10 files changed, 35 insertions(+), 42 deletions(-) diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeOpMapper.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeOpMapper.java index 75fc806d6..cb3b5e91c 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeOpMapper.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeOpMapper.java @@ -40,7 +40,7 @@ public class PineconeOpMapper implements OpMapper { * Create a new PineconeOpMapper implementing the {@link OpMapper} interface. * * @param adapter The associated {@link PineconeDriverAdapter} - * @param spaceCache A cached context Object of thpe {@link PineconeSpace}) + * @param spaceCache A cached context Object of the {@link PineconeSpace}) * @param cfg The configuration ({@link NBConfiguration}) for this nb run */ public PineconeOpMapper(PineconeDriverAdapter adapter, diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDeleteOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDeleteOpDispenser.java index 0eb6d157e..47fdf0eeb 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDeleteOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDeleteOpDispenser.java @@ -16,9 +16,7 @@ package io.nosqlbench.adapter.pinecone.opdispensers; -import com.google.protobuf.ListValue; import com.google.protobuf.Struct; -import com.google.protobuf.Value; import io.nosqlbench.adapter.pinecone.PineconeDriverAdapter; import io.nosqlbench.adapter.pinecone.PineconeSpace; import io.nosqlbench.adapter.pinecone.ops.PineconeDeleteOp; diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java index 091108b93..012f4a3dc 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java @@ -17,7 +17,6 @@ package io.nosqlbench.adapter.pinecone.opdispensers; import com.google.protobuf.Struct; -import com.google.protobuf.Value; import io.nosqlbench.adapter.pinecone.PineconeDriverAdapter; import io.nosqlbench.adapter.pinecone.PineconeSpace; import io.nosqlbench.adapter.pinecone.ops.PineconeDescribeIndexStatsOp; @@ -54,7 +53,7 @@ public class PineconeDescribeIndexStatsOpDispenser extends PineconeOpDispenser { /** * @param op The ParsedOp used to build the Request * @return A function that will take a long (the current cycle) and return a Pinecone DescribeIndexStatsRequest - * + *

* The pattern used here is to accommodate the way Request types are constructed for Pinecone. * Requests use a Builder pattern, so at time of instantiation the methods should be chained together. * For each method in the chain a function is created here and added to the chain of functions diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeFetchOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeFetchOpDispenser.java index 14e4fd057..2bcbfaa41 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeFetchOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeFetchOpDispenser.java @@ -53,7 +53,7 @@ public class PineconeFetchOpDispenser extends PineconeOpDispenser { /** * @param op The ParsedOp used to build the Request * @return A function that will take a long (the current cycle) and return a Pinecone FetchRequest - * + *

* The pattern used here is to accommodate the way Request types are constructed for Pinecone. * Requests use a Builder pattern, so at time of instantiation the methods should be chained together. * For each method in the chain a function is created here and added to the chain of functions diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java index aead8f195..947a460b6 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java @@ -25,6 +25,7 @@ import io.nosqlbench.adapter.pinecone.ops.PineconeOp; import io.nosqlbench.engine.api.activityimpl.BaseOpDispenser; import io.nosqlbench.engine.api.templating.ParsedOp; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.LongFunction; @@ -73,6 +74,16 @@ public abstract class PineconeOpDispenser extends BaseOpDispenser> extractFloatVals(LongFunction af) { + return l -> { + String[] vals = af.apply(l).split(","); + ArrayList fVals = new ArrayList<>(); + for (String val : vals) { + fVals.add(Float.valueOf(val)); + } + return fVals; + }; + } } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java index 3c7412c1d..6259fdf3c 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java @@ -102,14 +102,8 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { if (vFunc.isPresent()) { LongFunction finalFunc = rFunc; LongFunction af = vFunc.get(); - LongFunction> alf = l -> { - String[] vals = af.apply(l).split(","); - ArrayList fVals = new ArrayList<>(); - for (String val : vals) { - fVals.add(Float.valueOf(val)); - } - return fVals; - }; + + LongFunction> alf = extractFloatVals(af); rFunc = l -> finalFunc.apply(l).addAllVector(alf.apply(l)); } @@ -123,6 +117,7 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { return rFunc; } + /** * @param op the ParsedOp from which the Query Vector objects will be built * @return an Iterable Collection of QueryVector objects to be added to a Pinecone QueryRequest @@ -151,14 +146,12 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { qvb.setTopK((Integer) vector.get("top_k")); } if (vector.containsKey("filter")) { - LongFunction builtFilter = buildFilterStruct(l2 -> { - return (Map) vector.get("filter"); - }); + LongFunction builtFilter = buildFilterStruct(l2 -> (Map) vector.get("filter")); qvb.setFilter(builtFilter.apply(l)); } if (vector.containsKey("sparse_values")) { Map sparse_values = (Map) vector.get("sparse_values"); - rawValues = ((String) sparse_values.get("values")).split(","); + rawValues = sparse_values.get("values").split(","); floatValues = new ArrayList<>(); for (String val : rawValues) { floatValues.add(Float.valueOf(val)); diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java index 496b93c8d..b04ce64db 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java @@ -59,7 +59,7 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { /** * @param op the ParsedOp from which the SparseValues object will be built * @return a SparseValues Object to be added to a Pinecone UpdateRequest - * + *

* This method interrogates the subsection of the ParsedOp defined for SparseValues parameters and constructs * a SparseValues Object based on the included values, or returns null if this section is not populated. The * base function returns either the SparseValues Object or null, while the interior function builds the SparseValues @@ -88,8 +88,8 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { /** * @param op the ParsedOp from which the Metadata objects will be built - * @return an Metadata Struct to be added to a Pinecone UpdateRequest - * + * @return a Metadata Struct to be added to a Pinecone UpdateRequest + *

* This method interrogates the subsection of the ParsedOp defined for metadata parameters and constructs * a Metadata Struct based on the included values, or returns null if this section is not populated. The * base function returns either the Metadata Struct or null, while the interior function builds the Metadata @@ -114,14 +114,14 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { /** * @param op The ParsedOp used to build the Request * @return A function that will take a long (the current cycle) and return a Pinecone UpdateRequest Builder - * + *

* The pattern used here is to accommodate the way Request types are constructed for Pinecone. * Requests use a Builder pattern, so at time of instantiation the methods should be chained together. * For each method in the chain a function is created here and added to the chain of functions * called at time of instantiation. - * + *

* The Metadata and SparseValues objects used by the UpdateRequest are sufficiently sophisticated in their own - * building process that they have been broken out into separate methods. At runtime they are built separately + * building process that they have been broken out into separate methods. At runtime, they are built separately * and then added to the build chain by the builder returned by this method. */ private LongFunction createUpdateRequestFunction(ParsedOp op) { @@ -145,14 +145,7 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { if (vFunc.isPresent()) { LongFunction finalFunc = rFunc; LongFunction af = vFunc.get(); - LongFunction> alf = l -> { - String[] vals = af.apply(l).split(","); - ArrayList fVals = new ArrayList<>(); - for (String val : vals) { - fVals.add(Float.valueOf(val)); - } - return fVals; - }; + LongFunction> alf = extractFloatVals(af); rFunc = l -> finalFunc.apply(l).addAllValues(alf.apply(l)); } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java index 9c6a6e72c..ac59039fa 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java @@ -58,7 +58,7 @@ public class PineconeUpsertOpDispenser extends PineconeOpDispenser { /** * @param op the ParsedOp from which the Vector objects will be built * @return an Iterable Collection of Vector objects to be added to a Pinecone UpsertRequest - * + *

* This method interrogates the subsection of the ParsedOp defined for Vector parameters and constructs * a list of Vectors based on the included values, or returns null if this section is not populated. The * base function returns either the List of vectors or null, while the interior function builds the vectors @@ -82,7 +82,7 @@ public class PineconeUpsertOpDispenser extends PineconeOpDispenser { vb.addAllValues(floatValues); if (vector.containsKey("sparse_values")) { Map sparse_values = (Map) vector.get("sparse_values"); - rawValues = ((String) sparse_values.get("values")).split(","); + rawValues = sparse_values.get("values").split(","); floatValues = new ArrayList<>(); for (String val : rawValues) { floatValues.add(Float.valueOf(val)); @@ -98,7 +98,7 @@ public class PineconeUpsertOpDispenser extends PineconeOpDispenser { .build()); } if (vector.containsKey("metadata")) { - Map metadata_map = new HashMap(); + Map metadata_map = new HashMap<>(); BiConsumer stringToValue = (key, val) -> { Value targetval = null; if (val instanceof String) targetval = Value.newBuilder().setStringValue((String)val).build(); @@ -118,14 +118,14 @@ public class PineconeUpsertOpDispenser extends PineconeOpDispenser { /** * @param op The ParsedOp used to build the Request * @return A function that will take a long (the current cycle) and return a Pinecone UpsertRequest Builder - * + *

* The pattern used here is to accommodate the way Request types are constructed for Pinecone. * Requests use a Builder pattern, so at time of instantiation the methods should be chained together. * For each method in the chain a function is created here and added to the chain of functions * called at time of instantiation. - * + *

* The Vector objects used by the UpsertRequest are sufficiently sophisticated in their own - * building process that they have been broken out into a separate method. At runtime they are built separately + * building process that they have been broken out into a separate method. At runtime, they are built separately * and then added to the build chain by the builder returned by this method. */ private LongFunction createUpsertRequestFunc(ParsedOp op) { diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeDeleteOp.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeDeleteOp.java index 7291f09ef..c7ccde330 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeDeleteOp.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeDeleteOp.java @@ -17,10 +17,9 @@ package io.nosqlbench.adapter.pinecone.ops; import io.nosqlbench.engine.api.templating.ParsedOp; -import io.pinecone.PineconeException; +import io.pinecone.PineconeConnection; import io.pinecone.proto.DeleteRequest; import io.pinecone.proto.DeleteResponse; -import io.pinecone.PineconeConnection; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -44,6 +43,6 @@ public class PineconeDeleteOp extends PineconeOp { @Override public void run() { DeleteResponse response = connection.getBlockingStub().delete(request); - logger.debug("Pincecone delete request successful: " + response.toString()); + logger.debug("Pinecone delete request successful: " + response.toString()); } } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeUpdateOp.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeUpdateOp.java index c08ebbea3..d1ead4efd 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeUpdateOp.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/ops/PineconeUpdateOp.java @@ -43,6 +43,6 @@ public class PineconeUpdateOp extends PineconeOp { @Override public void run() { UpdateResponse response = connection.getBlockingStub().update(request); - logger.debug("UpdateResponse succesful: " + response.toString()); + logger.debug("UpdateResponse successful: " + response.toString()); } } From 6100a43b8099df3a6aedc64e001c6d0d8419d078 Mon Sep 17 00:00:00 2001 From: Mark Wolters Date: Thu, 1 Jun 2023 18:06:55 +0000 Subject: [PATCH 4/7] added logic to metadata processing for list and boolean types --- .../opdispensers/PineconeOpDispenser.java | 16 ++++++++++++++++ .../opdispensers/PineconeUpdateOpDispenser.java | 11 ++--------- .../opdispensers/PineconeUpsertOpDispenser.java | 11 ++--------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java index 947a460b6..4baf14ab5 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java @@ -26,8 +26,10 @@ import io.nosqlbench.engine.api.activityimpl.BaseOpDispenser; import io.nosqlbench.engine.api.templating.ParsedOp; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.BiConsumer; import java.util.function.LongFunction; public abstract class PineconeOpDispenser extends BaseOpDispenser { @@ -85,5 +87,19 @@ public abstract class PineconeOpDispenser extends BaseOpDispenser generateMetadataMap(Map metadata_values_map) { + Map metadata_map = new HashMap(); + BiConsumer stringToValue = (key, val) -> { + Value targetval = null; + if (val instanceof String) targetval = Value.newBuilder().setStringValue((String)val).build(); + else if (val instanceof Number) targetval = Value.newBuilder().setNumberValue((((Number) val).doubleValue())).build(); + else if (val instanceof List) targetval = Value.newBuilder().setListValue(generateListValue((List) val)).build(); + else if (val instanceof Boolean) targetval = Value.newBuilder().setBoolValue((Boolean) val).build(); + else throw new RuntimeException("Unsupported metadata value type"); + metadata_map.put(key, targetval); + }; + metadata_values_map.forEach(stringToValue); + return metadata_map; + } } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java index b04ce64db..2d21430bb 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java @@ -98,16 +98,9 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { private LongFunction createUpdateMetadataFunction(ParsedOp op) { Optional> mFunc = op.getAsOptionalFunction("metadata", Map.class); return mFunc.>map(mapLongFunction -> l -> { - Map metadata_map = new HashMap(); - BiConsumer stringToValue = (key, val) -> { - Value targetval = null; - if (val instanceof String) targetval = Value.newBuilder().setStringValue((String)val).build(); - else if (val instanceof Number) targetval = Value.newBuilder().setNumberValue((((Number) val).doubleValue())).build(); - metadata_map.put(key, targetval); - }; Map metadata_values_map = mapLongFunction.apply(l); - metadata_values_map.forEach(stringToValue); - return UpdateRequest.newBuilder().getSetMetadataBuilder().putAllFields(metadata_map).build(); + return UpdateRequest.newBuilder().getSetMetadataBuilder() + .putAllFields(generateMetadataMap(metadata_values_map)).build(); }).orElse(null); } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java index ac59039fa..a9db7ddf4 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java @@ -16,6 +16,7 @@ package io.nosqlbench.adapter.pinecone.opdispensers; +import com.google.protobuf.ListValue; import com.google.protobuf.Struct; import com.google.protobuf.Value; import io.nosqlbench.adapter.pinecone.PineconeDriverAdapter; @@ -98,16 +99,8 @@ public class PineconeUpsertOpDispenser extends PineconeOpDispenser { .build()); } if (vector.containsKey("metadata")) { - Map metadata_map = new HashMap<>(); - BiConsumer stringToValue = (key, val) -> { - Value targetval = null; - if (val instanceof String) targetval = Value.newBuilder().setStringValue((String)val).build(); - else if (val instanceof Number) targetval = Value.newBuilder().setNumberValue((((Number) val).doubleValue())).build(); - metadata_map.put(key, targetval); - }; Map metadata_values_map = (Map) vector.get("metadata"); - metadata_values_map.forEach(stringToValue); - vb.setMetadata(Struct.newBuilder().putAllFields(metadata_map).build()); + vb.setMetadata(Struct.newBuilder().putAllFields(generateMetadataMap(metadata_values_map)).build()); } returnVectors.add(vb.build()); } From 5551c1fb133ad0609de07dc1b34622d8900e7efd Mon Sep 17 00:00:00 2001 From: Mark Wolters Date: Thu, 1 Jun 2023 19:24:19 +0000 Subject: [PATCH 5/7] code cleanup --- .../opdispensers/PineconeOpDispenser.java | 4 ++-- .../activities/pinecone-query-all.yaml | 14 +++++++++++++ .../activities/pinecone-upsert-scenario.yaml | 20 +++++++++++++++++++ .../resources/activities/pinecone-upsert.yaml | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 adapter-pinecone/src/main/resources/activities/pinecone-query-all.yaml create mode 100644 adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java index 4baf14ab5..d2d90d0b7 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java @@ -88,9 +88,9 @@ public abstract class PineconeOpDispenser extends BaseOpDispenser generateMetadataMap(Map metadata_values_map) { - Map metadata_map = new HashMap(); + Map metadata_map = new HashMap<>(); BiConsumer stringToValue = (key, val) -> { - Value targetval = null; + Value targetval; if (val instanceof String) targetval = Value.newBuilder().setStringValue((String)val).build(); else if (val instanceof Number) targetval = Value.newBuilder().setNumberValue((((Number) val).doubleValue())).build(); else if (val instanceof List) targetval = Value.newBuilder().setListValue(generateListValue((List) val)).build(); diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-query-all.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-query-all.yaml new file mode 100644 index 000000000..ff525af9f --- /dev/null +++ b/adapter-pinecone/src/main/resources/activities/pinecone-query-all.yaml @@ -0,0 +1,14 @@ +scenarios: + default: + query: run driver=pinecone tags==blocks:query cycles=10 + +blocks: + query: + ops: + op1: + query: "test-index" + vector: "0.8602578079921012,0.12103044768221516,0.7737329191858439,0.4521093269320254,0.29351661477669416,0.4261807015226558,0.14131665592103335,0.882370813029422,0.4412833140430886,0.9916525700115515" + namespace: "example_namespace" + top_k: 1000 + include_values: true + include_metadata: true diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml new file mode 100644 index 000000000..ad9d726f2 --- /dev/null +++ b/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml @@ -0,0 +1,20 @@ +scenarios: + default: + upsert: run driver=pinecone tags==blocks:upsert cycles=1000 cycles===TEMPLATE(rampup-cycles,10000000) threads=auto + +bindings: + id: Mod(<>); ToString() -> String + vector_value: ListSizedHashed(<>,HashRange(0.0f,100.0f) -> float); ToString() -> String + city: Cities() + +blocks: + upsert: + ops: + op1: + upsert: "test-index" + namespace: "example_namespace" + upsert_vectors: + - id: {id} + values: {vector_value} + metadata: + city: {city} diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml index dddd5e6bd..1efcabe74 100644 --- a/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml +++ b/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml @@ -1,6 +1,6 @@ scenarios: default: - query: run driver=pinecone tags==blocks:upsert cycles=1000 + upsert: run driver=pinecone tags==blocks:upsert cycles=1000 blocks: upsert: From 9023afac39a4b69afdadf24dbce37ecdb582dc1a Mon Sep 17 00:00:00 2001 From: Mark Wolters Date: Fri, 2 Jun 2023 17:31:34 +0000 Subject: [PATCH 6/7] added functionality to handle vector values in format of text or list of text,float,double --- .../adapter/pinecone/PineconeSpace.java | 2 +- ...PineconeDescribeIndexStatsOpDispenser.java | 2 +- .../opdispensers/PineconeOpDispenser.java | 48 +++++++++++++++---- .../PineconeQueryOpDispenser.java | 27 +++-------- .../PineconeUpdateOpDispenser.java | 26 ++++------ .../PineconeUpsertOpDispenser.java | 24 ++-------- .../activities/pinecone-query-multiple.yaml | 12 ++++- .../activities/pinecone-upsert-scenario.yaml | 11 +++-- .../resources/activities/pinecone-upsert.yaml | 12 ++++- .../pinecone/PineconeOpMapperTest.java | 10 +++- 10 files changed, 94 insertions(+), 80 deletions(-) diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeSpace.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeSpace.java index c6512b181..c530fae26 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeSpace.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/PineconeSpace.java @@ -65,7 +65,7 @@ public class PineconeSpace { } /** - * Connections are index-specific so we need to allow for multiple connection management across indices. + * Connections are index-specific, so we need to allow for multiple connection management across indices. * However, note that a single connection object is thread safe and can be used by multiple clients. * * @param index The database index for which a connection is being requested diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java index 012f4a3dc..e62fafc58 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeDescribeIndexStatsOpDispenser.java @@ -57,7 +57,7 @@ public class PineconeDescribeIndexStatsOpDispenser extends PineconeOpDispenser { * The pattern used here is to accommodate the way Request types are constructed for Pinecone. * Requests use a Builder pattern, so at time of instantiation the methods should be chained together. * For each method in the chain a function is created here and added to the chain of functions - * called at time of instantiation. Additionally some of the arguments to the builder methods require + * called at time of instantiation. Additionally, some of the arguments to the builder methods require * creation through their own builder process. In these cases the pattern adopted includes multiple layers of * functions in order to build all objects in the correct manner and ordering. */ diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java index d2d90d0b7..5a2c3d4c8 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeOpDispenser.java @@ -76,15 +76,8 @@ public abstract class PineconeOpDispenser extends BaseOpDispenser> extractFloatVals(LongFunction af) { - return l -> { - String[] vals = af.apply(l).split(","); - ArrayList fVals = new ArrayList<>(); - for (String val : vals) { - fVals.add(Float.valueOf(val)); - } - return fVals; - }; + protected LongFunction> extractFloatVals(LongFunction af) { + return l -> this.getVectorValues(af.apply(l)); } protected Map generateMetadataMap(Map metadata_values_map) { @@ -102,4 +95,41 @@ public abstract class PineconeOpDispenser extends BaseOpDispenser getVectorValues(Object rawVectorValues) { + List floatValues; + if (rawVectorValues instanceof String) { + floatValues = new ArrayList<>(); + String[] rawValues = (((String) rawVectorValues).split(",")); + for (String val : rawValues) { + floatValues.add(Float.valueOf(val)); + } + } else if (rawVectorValues instanceof List) { + floatValues = switch (((List) rawVectorValues).get(0).getClass().getSimpleName()) { + case "Float" -> (List) rawVectorValues; + case "Double" -> ((List) rawVectorValues).stream().map(Double::floatValue).toList(); + case "String" -> ((List) rawVectorValues).stream().map(Float::parseFloat).toList(); + default -> throw new RuntimeException("Invalid type specified for values"); + }; + } else { + throw new RuntimeException("Invalid type specified for values"); + } + return floatValues; + } + + protected List getIndexValues(Object rawIndexValues) { + List intValues; + if (rawIndexValues instanceof String) { + intValues = new ArrayList<>(); + String[] rawValues = (((String) rawIndexValues).split(",")); + for (String val : rawValues) { + intValues.add(Integer.valueOf(val)); + } + } else if (rawIndexValues instanceof List) { + intValues = (List) rawIndexValues; + }else { + throw new RuntimeException("Invalid type specified for Index values"); + } + return intValues; + } + } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java index 6259fdf3c..c537016b4 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeQueryOpDispenser.java @@ -98,12 +98,12 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { rFunc = l -> finalFunc.apply(l).setIncludeValues(af.apply(l)); } - Optional> vFunc = op.getAsOptionalFunction("vector", String.class); + Optional> vFunc = op.getAsOptionalFunction("vector", Object.class); if (vFunc.isPresent()) { LongFunction finalFunc = rFunc; - LongFunction af = vFunc.get(); + LongFunction af = vFunc.get(); - LongFunction> alf = extractFloatVals(af); + LongFunction> alf = extractFloatVals(af); rFunc = l -> finalFunc.apply(l).addAllVector(alf.apply(l)); } @@ -135,12 +135,7 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { List> vectors = listLongFunction.apply(l); for (Map vector : vectors) { QueryVector.Builder qvb = QueryVector.newBuilder(); - String[] rawValues = ((String) vector.get("values")).split(","); - ArrayList floatValues = new ArrayList<>(); - for (String val : rawValues) { - floatValues.add(Float.valueOf(val)); - } - qvb.addAllValues(floatValues); + qvb.addAllValues(getVectorValues(vector.get("values"))); qvb.setNamespace((String) vector.get("namespace")); if (vector.containsKey("top_k")) { qvb.setTopK((Integer) vector.get("top_k")); @@ -151,19 +146,9 @@ public class PineconeQueryOpDispenser extends PineconeOpDispenser { } if (vector.containsKey("sparse_values")) { Map sparse_values = (Map) vector.get("sparse_values"); - rawValues = sparse_values.get("values").split(","); - floatValues = new ArrayList<>(); - for (String val : rawValues) { - floatValues.add(Float.valueOf(val)); - } - rawValues = sparse_values.get("indices").split(","); - List intValues = new ArrayList<>(); - for (String val : rawValues) { - intValues.add(Integer.valueOf(val)); - } qvb.setSparseValues(SparseValues.newBuilder() - .addAllValues(floatValues) - .addAllIndices(intValues) + .addAllValues(getVectorValues(sparse_values.get("values"))) + .addAllIndices(getIndexValues(sparse_values.get("indices"))) .build()); } returnVectors.add(qvb.build()); diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java index 2d21430bb..e38d8cd93 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpdateOpDispenser.java @@ -17,7 +17,6 @@ package io.nosqlbench.adapter.pinecone.opdispensers; import com.google.protobuf.Struct; -import com.google.protobuf.Value; import io.nosqlbench.adapter.pinecone.PineconeDriverAdapter; import io.nosqlbench.adapter.pinecone.PineconeSpace; import io.nosqlbench.adapter.pinecone.ops.PineconeOp; @@ -28,8 +27,9 @@ import io.pinecone.proto.UpdateRequest; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.util.*; -import java.util.function.BiConsumer; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.function.LongFunction; public class PineconeUpdateOpDispenser extends PineconeOpDispenser { @@ -69,19 +69,9 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { Optional> mFunc = op.getAsOptionalFunction("sparse_values", Map.class); return mFunc.>map(mapLongFunction -> l -> { Map sparse_values_map = mapLongFunction.apply(l); - String[] rawValues = (sparse_values_map.get("values")).split(","); - ArrayList floatValues = new ArrayList<>(); - for (String val : rawValues) { - floatValues.add(Float.valueOf(val)); - } - rawValues = sparse_values_map.get("indices").split(","); - List intValues = new ArrayList<>(); - for (String val : rawValues) { - intValues.add(Integer.valueOf(val)); - } return SparseValues.newBuilder() - .addAllValues(floatValues) - .addAllIndices(intValues) + .addAllValues(getVectorValues(sparse_values_map.get("values"))) + .addAllIndices(getIndexValues(sparse_values_map.get("indices"))) .build(); }).orElse(null); } @@ -134,11 +124,11 @@ public class PineconeUpdateOpDispenser extends PineconeOpDispenser { rFunc = l -> finalFunc.apply(l).setId(af.apply(l)); } - Optional> vFunc = op.getAsOptionalFunction("values", String.class); + Optional> vFunc = op.getAsOptionalFunction("values", Object.class); if (vFunc.isPresent()) { LongFunction finalFunc = rFunc; - LongFunction af = vFunc.get(); - LongFunction> alf = extractFloatVals(af); + LongFunction af = vFunc.get(); + LongFunction> alf = extractFloatVals(af); rFunc = l -> finalFunc.apply(l).addAllValues(alf.apply(l)); } diff --git a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java index a9db7ddf4..033929b99 100644 --- a/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java +++ b/adapter-pinecone/src/main/java/io/nosqlbench/adapter/pinecone/opdispensers/PineconeUpsertOpDispenser.java @@ -16,9 +16,7 @@ package io.nosqlbench.adapter.pinecone.opdispensers; -import com.google.protobuf.ListValue; import com.google.protobuf.Struct; -import com.google.protobuf.Value; import io.nosqlbench.adapter.pinecone.PineconeDriverAdapter; import io.nosqlbench.adapter.pinecone.PineconeSpace; import io.nosqlbench.adapter.pinecone.ops.PineconeOp; @@ -31,7 +29,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.*; -import java.util.function.BiConsumer; import java.util.function.LongFunction; public class PineconeUpsertOpDispenser extends PineconeOpDispenser { @@ -75,27 +72,12 @@ public class PineconeUpsertOpDispenser extends PineconeOpDispenser { Vector.Builder vb = Vector.newBuilder(); // No need to check for key, it is invalid if id is not there, let it throw an exception vb.setId(vector.get("id").toString()); - String[] rawValues = ((String) vector.get("values")).split(","); - ArrayList floatValues = new ArrayList<>(); - for (String val : rawValues) { - floatValues.add(Float.valueOf(val)); - } - vb.addAllValues(floatValues); + vb.addAllValues(getVectorValues(vector.get("values"))); if (vector.containsKey("sparse_values")) { Map sparse_values = (Map) vector.get("sparse_values"); - rawValues = sparse_values.get("values").split(","); - floatValues = new ArrayList<>(); - for (String val : rawValues) { - floatValues.add(Float.valueOf(val)); - } - rawValues = sparse_values.get("indices").split(","); - List intValues = new ArrayList<>(); - for (String val : rawValues) { - intValues.add(Integer.valueOf(val)); - } vb.setSparseValues(SparseValues.newBuilder() - .addAllValues(floatValues) - .addAllIndices(intValues) + .addAllValues(getVectorValues(sparse_values.get("values"))) + .addAllIndices(getIndexValues(sparse_values.get("indices"))) .build()); } if (vector.containsKey("metadata")) { diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml index 185deab5b..427ff55d9 100644 --- a/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml +++ b/adapter-pinecone/src/main/resources/activities/pinecone-query-multiple.yaml @@ -18,7 +18,17 @@ blocks: operator: "$eq" comparator: "movies" - id: "2" - values: "0.8602578079921012,0.12103044768221516,0.7737329191858439,0.4521093269320254,0.29351661477669416,0.4261807015226558,0.14131665592103335,0.882370813029422,0.4412833140430886,0.9916525700115515" + values: + - 0.8602578079921012 + - 0.12103044768221516 + - 0.7737329191858439 + - 0.4521093269320254 + - 0.29351661477669416 + - 0.4261807015226558 + - 0.14131665592103335 + - 0.882370813029422 + - 0.4412833140430886 + - 0.9916525700115515 namespace: "example_namespace" top_k: 3 filter: diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml index ad9d726f2..241889bd6 100644 --- a/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml +++ b/adapter-pinecone/src/main/resources/activities/pinecone-upsert-scenario.yaml @@ -1,10 +1,11 @@ scenarios: default: - upsert: run driver=pinecone tags==blocks:upsert cycles=1000 cycles===TEMPLATE(rampup-cycles,10000000) threads=auto + upsert: run driver=pinecone tags==block:upsert cycles===TEMPLATE(upsert-cycles,10000000) threads=auto + query: run driver=pinecone tags==block:query cycles===TEMPLATE(query-cycles,10000000) threads=auto bindings: id: Mod(<>); ToString() -> String - vector_value: ListSizedHashed(<>,HashRange(0.0f,100.0f) -> float); ToString() -> String + vector_value: ListSizedHashed(<>,HashRange(0.0f,100.0f) -> float) city: Cities() blocks: @@ -14,7 +15,7 @@ blocks: upsert: "test-index" namespace: "example_namespace" upsert_vectors: - - id: {id} - values: {vector_value} + - id: "{id}" + values: "{vector_value}" metadata: - city: {city} + city: "{city}" diff --git a/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml b/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml index 1efcabe74..ac55b9ffc 100644 --- a/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml +++ b/adapter-pinecone/src/main/resources/activities/pinecone-upsert.yaml @@ -10,7 +10,17 @@ blocks: namespace: "example_namespace" upsert_vectors: - id: "item_0" - values: "0.8238042071878214,0.6579519242642494,0.2772098082162267,0.11434681368630942,0.7496610470760962,0.08914691629812001,0.13249049306247204,0.8875869003282576,0.21615924382746318,0.8454796243176312" + values: + - 0.8238042071878214 + - 0.6579519242642494 + - 0.2772098082162267 + - 0.11434681368630942 + - 0.7496610470760962 + - 0.08914691629812001 + - 0.13249049306247204 + - 0.8875869003282576 + - 0.21615924382746318 + - 0.8454796243176312 metadata: category: "sports" colors: "blue,red,green" diff --git a/adapter-pinecone/src/test/java/io/nosqlbench/adapter/pinecone/PineconeOpMapperTest.java b/adapter-pinecone/src/test/java/io/nosqlbench/adapter/pinecone/PineconeOpMapperTest.java index fb8a890ba..77f55260b 100644 --- a/adapter-pinecone/src/test/java/io/nosqlbench/adapter/pinecone/PineconeOpMapperTest.java +++ b/adapter-pinecone/src/test/java/io/nosqlbench/adapter/pinecone/PineconeOpMapperTest.java @@ -198,7 +198,10 @@ public class PineconeOpMapperTest { index: "test-index" upsert_vectors: - id: 1 - values: "1.0,2.0,3.0" + values: + - 1.0 + - 2.0 + - 3.0 sparse_values: indices: "1,2,3" values: "4.0,5.0,6.0" @@ -206,7 +209,10 @@ public class PineconeOpMapperTest { key1: "val1" key2: 2 - id: 2 - values: "7.0,8.0,9.0" + values: + - 7.0 + - 8.0 + - 9.0 sparse_values: indices: "4,5,6" values: "1.1,2.2,3.3" From a9d65796d37fa9890e03c54f7471cf66846f680b Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Tue, 6 Jun 2023 17:05:15 +0100 Subject: [PATCH 7/7] fix: upgrade org.apache.tinkerpop:gremlin-core from 3.6.3 to 3.6.4 (#1314) Snyk has created this PR to upgrade org.apache.tinkerpop:gremlin-core from 3.6.3 to 3.6.4. See this package in Maven Repository: https://mvnrepository.com/artifact/org.apache.tinkerpop/gremlin-core/ See this project in Snyk: https://app.snyk.io/org/nosqlbench/project/73081f87-c1b7-4c91-b407-1cb299565642?utm_source=github&utm_medium=referral&page=upgrade-pr --- adapter-cqld4/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapter-cqld4/pom.xml b/adapter-cqld4/pom.xml index 6f0225563..cf163ac5d 100644 --- a/adapter-cqld4/pom.xml +++ b/adapter-cqld4/pom.xml @@ -50,7 +50,7 @@ org.apache.tinkerpop gremlin-core - 3.6.3 + 3.6.4 org.apache.tinkerpop