You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "maedhroz (via GitHub)" <gi...@apache.org> on 2023/03/13 20:43:07 UTC

[GitHub] [cassandra] maedhroz commented on a diff in pull request #2195: [CASSANDRA-18302] Statement source descriptions

maedhroz commented on code in PR #2195:
URL: https://github.com/apache/cassandra/pull/2195#discussion_r1134593113


##########
src/java/org/apache/cassandra/cql3/statements/QualifiedStatement.java:
##########
@@ -81,13 +81,27 @@ public String toString()
 
     public static abstract class Composite extends QualifiedStatement
     {
+        private static final int RAW_TEXT_MAX_LENGTH = 4096;
+
+        private String txt;
+
         Composite()
         {
             super(null);
         }
 
         protected abstract Iterable<? extends QualifiedStatement> getStatements();
 
+        public void setRawText(String txt)
+        {
+            this.txt = txt != null ? txt.substring(0, Math.min(txt.length(), RAW_TEXT_MAX_LENGTH)) : null;

Review Comment:
   nit: if we actually do exceed the max length, it might be a nice UX tweak to include a "blah blah..." (ellipsis) at the end just to make it clear there's more content (but we're truncating).



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org