bbotella commented on code in PR #3562:
URL: https://github.com/apache/cassandra/pull/3562#discussion_r1917629774


##########
src/java/org/apache/cassandra/cql3/Json.java:
##########
@@ -323,4 +361,67 @@ static Map<ColumnIdentifier, Term> parseJson(String 
jsonString, Collection<Colum
             throw new InvalidRequestException(exc.getMessage());
         }
     }
+
+    static Term.Raw getUnpreparedTerm(ColumnSpecification spec, Object 
parsedJsonObject)
+    {
+        if (spec.type.isNumber())
+            return 
Constants.Literal.floatingPoint(parsedJsonObject.toString());
+        if (spec.type.isString())
+            return Constants.Literal.string(parsedJsonObject.toString());
+        return null;
+    }
+
+    static Map<ColumnIdentifier, Term.Raw> parseUnpreparedJson(String 
jsonString, Collection<ColumnMetadata> expectedReceivers)
+    {
+        try
+        {
+            Map<String, Object> valueMap = 
JsonUtils.JSON_OBJECT_MAPPER.readValue(jsonString, Map.class);

Review Comment:
   Good catch



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