Repository navigation
Conversation
📈 Unit Test Coverage Delta vs Main Branch
|
Unit Test Coverage Report
|
📈 Integration Test Coverage Delta vs Main Branch (dse69-it)
|
Integration Test Coverage Report (dse69-it)
|
📈 Integration Test Coverage Delta vs Main Branch (hcd-it)
|
Integration Test Coverage Report (hcd-it)
|
There was a problem hiding this comment.
-1 Blocking this merging.
There are two possible fixes here: either the API support flag is wrong (we dont support it) OR we actually should support it and the bug is that we dont.
we need to decide on what we want to do before letting AI write code. Also, PR comments such as these are not very helpful it is just a mash of words
|
There is an existing test the confirms some code things we should not be able to filter on a counter BUT checking the design docs we said it was possible to filter on a counter. we need to work out what is the correct behaviour |
|
Good point @amorton, digging into this in more detail (i.e., whether there's a technical reason why we don't support it, and if so, can we overcome that and support it, as the spec indicates that we want to do) |
db7843d to
f06232c
Compare
f06232c to
3603a16
Compare
A table with a counter column was described with apiSupport.filter:true, but filtering on a counter actually failed at runtime with INVALID_FILTER_COLUMN_VALUES. The describe output was correct — counters ARE filterable in CQL via ALLOW FILTERING (they just cannot be indexed) — the gap was a missing JSON->CQL codec. Filter literals arrive as BigDecimal/BigInteger, but COUNTER only registered COUNTER_FROM_LONG, so codec lookup threw ToCQLCodecException. Add COUNTER_FROM_BIG_DECIMAL and COUNTER_FROM_BIG_INTEGER (mirroring BIGINT's longValueExact variants) and register them. With the codecs in place, WhereCQLClauseAnalyzer proceeds with ALLOW FILTERING and emits a MISSING_INDEX warning, so apiSupport.filter stays true. This reverses the earlier flip-to-false approach: keep filter=true and make the runtime match it. insert/update remain unsupported (insert=false / Update.NONE), and isUnsupportedDML() is unchanged (already true via insert=false). Tests: - JSONCodecRegistryTest: add COUNTER cases for Long/BigInteger/BigDecimal -> Long binding. - UnsupportedTypeTableIntegrationTest.Counter: assert describe reports filter:true; rewrite filterCounter to seed a counter via raw CQL and expect the row back with a MISSING_INDEX warning.
3603a16 to
fbeb50c
Compare
|
@amorton Updated the PR based on our investigation last week! |
What this PR does:
Adds
BigDecimalandBigIntegercounter codecs so JSON numeric filter values convert to CQL counter values. Adds regression coverage for successful counter filtering, exact numeric conversion, overflow, and non-integral input.Which issue(s) this PR fixes:
Fixes #2462
Verification:
./mvnw test -Dtest=JSONCodecRegistryTest— 170 tests, 0 failures, 0 errors, 0 skipped; formatting checks passed.Not rerun:
UnsupportedTypeTableIntegrationTest, the full unit suite, or integration suites.Checklist