AMashenkov commented on code in PR #1831:
URL: https://github.com/apache/ignite-3/pull/1831#discussion_r1147398795
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java:
##########
@@ -149,7 +151,13 @@ public int defaultPageSize() {
/** {@inheritDoc} */
@Override
public SessionBuilder toBuilder() {
- return new SessionBuilderImpl(qryProc, new HashMap<>(props.toMap()))
+ Map<String, Object> propertyMap = new HashMap<>();
+
+ for (Map.Entry<Property<?>, Object> entry : props) {
+ propertyMap.put(entry.getKey().name, entry.getValue());
+ }
+
+ return new SessionBuilderImpl(qryProc, propertyMap)
Review Comment:
```suggestion
return new SessionBuilderImpl(qryProc, props.toMap())
```
Actually, PropertiesHolder API looks ambiguous.
It is not clean if toMap() return a copy of properties, or just adapter or
internal map.
I'd expect toMap() returns a copy of props, and it make sense to add asMap()
that will avoid copying.
--
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]