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


##########
test/harry/main/org/apache/cassandra/harry/model/ASTSingleTableModel.java:
##########
@@ -2572,6 +2446,46 @@ private TokenCondition(Inequality inequality, Token 
token)
         }
     }
 
+    private static class LikeCondition
+    {
+        private final ByteBuffer pattern;
+
+        private LikeCondition(ByteBuffer pattern)
+        {
+            this.pattern = pattern;
+        }
+
+        private boolean matches(AbstractType<?> type, ByteBuffer value)
+        {
+            String valueStr = type.getString(value);
+            String patternStr = type.getString(pattern);
+
+            if (patternStr.startsWith("%") && patternStr.endsWith("%"))
+            {
+                // Contains
+                String substring = patternStr.substring(1, patternStr.length() 
- 1);
+                return valueStr.contains(substring);
+            }
+            else if (patternStr.startsWith("%"))
+            {
+                // Suffix
+                String suffix = patternStr.substring(1);
+                return valueStr.endsWith(suffix);
+            }
+            else if (patternStr.endsWith("%"))
+            {
+                // Prefix
+                String prefix = patternStr.substring(0, patternStr.length() - 
1);
+                return valueStr.startsWith(prefix);
+            }
+            else
+            {
+                // Exact
+                return valueStr.equals(patternStr);

Review Comment:
   you don't generate this case



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