ptupitsyn commented on a change in pull request #245:
URL: https://github.com/apache/ignite-3/pull/245#discussion_r677273857



##########
File path: 
modules/table/src/main/java/org/apache/ignite/internal/table/TupleBuilderImpl.java
##########
@@ -89,72 +91,164 @@ public TupleBuilder set(Column col, Object value) {
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T valueOrDefault(String colName, T def) {
-        return (T)map.getOrDefault(colName, def);
+    @Override public String columnName(int columnIndex) {
+        return schemaDesc.column(columnIndex).name();
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T value(String colName) {
-        return (T)map.get(colName);
+    @Override public Integer columnIndex(String columnName) {
+        var col = schemaDesc.column(columnName);
+
+        return col == null ? null : col.schemaIndex();

Review comment:
       We don't expose schemas to the user. Let's abstract away from schemas.
   
   Every Tuple is a set of values. Values can be accessed by name and by index. 
It provides a way to access Tuple contents efficiently, without hash lookups, 
e.g.:
   
   ```
   for (int i = 0; i < tuple.columnCount(); i++) {
       System.out.println(tuple.columnName(i) + ": " + tuple.value(i));
   } 
   ```
   
   There is nothing in the new API that requires a schema underneath. For 
example, client-side Live Schema Tuple can be backed by a `LinkedHashMap` 
without any prior schema knowledge.




-- 
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]


Reply via email to