-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CASSANDRA-20503 Add BATCH support for AST Harry and update existing fuzz tests #4024
base: trunk
Are you sure you want to change the base?
Conversation
test/distributed/org/apache/cassandra/distributed/test/cql3/SingleNodeTableWalkTest.java
Outdated
Show resolved
Hide resolved
String cql = StringUtils.escapeControlChars(stmt.visit(debug).toCQL(CQLFormatter.None.instance)); | ||
CQLFormatter formatter = CQLFormatter.None.instance; | ||
if (stmt.kind() == Statement.Kind.BATCH) // its really hard to read these without this... | ||
formatter = new CQLFormatter.PrettyPrint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i kinda want a new one, the sub elements are not formatted but the batch is
@@ -236,8 +236,16 @@ private RowState updateRowState(RowState currentState, IntFunction<Bijections.Bi | |||
{ | |||
// Timestamp collision case | |||
Bijections.Bijection<?> column = columns.apply(i); | |||
if (column.compare(vds[i], currentState.vds[i]) > 0) | |||
// writing a null is the same as a tombstone, which has higher priority | |||
if (vds[i] == MagicConstants.NIL_DESCR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: merge this into one if
@@ -149,7 +149,7 @@ public void addConditions(Clustering<?> clustering, Collection<ColumnCondition> | |||
} | |||
else if (!(condition instanceof ColumnsConditions)) | |||
{ | |||
throw new InvalidRequestException("Cannot mix IF conditions and IF NOT EXISTS for the same row"); | |||
throw new InvalidRequestException("Cannot mix IF conditions and " + ((ToCQL) condition).toCQL() + " for the same row"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was an error msg bug, IF EXISTS
was what the user provided but we told them IF NOT EXISTS
.
… the static row isnt empty!
var simple = (CasCondition.Simple) condition; | ||
switch (simple) | ||
{ | ||
case Exists: | ||
return hasRow; | ||
return partitionOrRow ? hasPartition : hasRow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out that CAS defines partition EXISTS
as
- partition is defined
- static row is not empty
The previous logic defined it only as #1 so had to make this change to support the empty static row check
…hould have been s0 != null
…ut liveness existed so the row also exists!
private final Map<Symbol, MultiCell> staticMultiCell; | ||
@Nullable | ||
private final Map<Long, Map<Symbol, MultiCell>> rowMultiCell; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base harry supports cell resolution for non-mutli cell columns but doesn't support multi cell. Spoke with Alex and said he didn't need this PR to push this logic into base harry, so leaving here for the moment...
I do think this "could" be unified better... having a concept of Cell
in the API would let me push this logic to the executor layer rather than have this lagic also handle execution... that is a larger refactor and something to think through.
…l need to support IF NOT EXISTS
this patch got too big so split part of it out into #4044.
#4044 focuses on the CAS related changes and the handling of timestamp. Multi cell conflicts are left for this patch