blerer commented on code in PR #2655:
URL: https://github.com/apache/cassandra/pull/2655#discussion_r1378632501
##########
src/java/org/apache/cassandra/db/marshal/TupleType.java:
##########
@@ -404,20 +440,24 @@ public ByteBuffer fromString(String source)
throw new MarshalException(String.format("Invalid tuple literal:
too many elements. Type %s expects %d but got %d",
asCQL3Type(), size(),
fieldStrings.size()));
- ByteBuffer[] fields = new ByteBuffer[fieldStrings.size()];
+ List<ByteBuffer> fields = new ArrayList<>(fieldStrings.size());
for (int i = 0; i < fieldStrings.size(); i++)
{
String fieldString = fieldStrings.get(i);
// We use @ to represent nulls
if (fieldString.equals("@"))
- continue;
-
- AbstractType<?> type = type(i);
- fieldString =
ESCAPED_COLON_PAT.matcher(fieldString).replaceAll(COLON);
- fieldString = ESCAPED_AT_PAT.matcher(fieldString).replaceAll(AT);
- fields[i] = type.fromString(fieldString);
+ {
+ fields.add(null);
Review Comment:
Because it was an array so you just add to skip the value.
--
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]