ptupitsyn commented on a change in pull request #245:
URL: https://github.com/apache/ignite-3/pull/245#discussion_r677186256
##########
File path:
modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTupleBuilder.java
##########
@@ -18,33 +18,41 @@
package org.apache.ignite.internal.client.table;
import java.util.BitSet;
-import java.util.HashMap;
+import java.util.Iterator;
import java.util.UUID;
import org.apache.ignite.binary.BinaryObject;
-import org.apache.ignite.lang.IgniteException;
import org.apache.ignite.table.Tuple;
import org.apache.ignite.table.TupleBuilder;
+import org.jetbrains.annotations.NotNull;
/**
* Client tuple builder.
*/
public final class ClientTupleBuilder implements TupleBuilder, Tuple {
/** Columns values. */
- private final HashMap<String, Object> map = new HashMap<>();
+ private final Object[] vals;
+
+ /** Schema. */
+ private final ClientSchema schema;
/**
- * Gets the underlying map.
+ * Constructor.
*
- * @return Underlying map
+ * @param schema Schema.
*/
- public HashMap<String, Object> map() {
- return map;
+ public ClientTupleBuilder(ClientSchema schema) {
+ assert schema != null;
+
+ this.schema = schema;
+ this.vals = new Object[schema.columns().length];
}
/** {@inheritDoc} */
@Override public TupleBuilder set(String colName, Object value) {
- map.put(colName, value);
+ var col = schema.column(colName);
+
+ vals[col.schemaIndex()] = value;
Review comment:
Thin client does not support live schema yet. I've added a TODO with a
ticket https://issues.apache.org/jira/browse/IGNITE-15194.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]