dcapwell commented on code in PR #2190:
URL: https://github.com/apache/cassandra/pull/2190#discussion_r1128288045


##########
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:
##########
@@ -168,6 +168,33 @@ public void validate(ClientState state)
             statement.validate(state);
     }
 
+    @Override
+    public Iterable<CQLStatement> getStatements()
+    {
+        return () -> {
+            Stream<CQLStatement> stream = assignments.stream().map(n -> 
n.select);
+            if (returningSelect != null)
+                stream = Stream.concat(stream, 
Stream.of(returningSelect.select));
+            stream = Stream.concat(stream, updates.stream());
+            return stream.iterator();
+        };
+    }
+
+    @Override
+    public ResultSet.ResultMetadata getResultMetadata()
+    {
+        if (returningSelect != null)

Review Comment:
   true we could, but I don't think we need to as the access is short lived 
here.  prepared statements holds ref in 
`org.apache.cassandra.cql3.QueryHandler.Prepared#Prepared` and txn statement 
calls this after we get the response back from the accord coordinator, so by 
keeping it something we "compute" we keep this object in short term memory 
rather than make it used 2 times in long term memory



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to