[
https://issues.apache.org/jira/browse/CASSANDRA-17623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Doug Rohrer updated CASSANDRA-17623:
------------------------------------
Test and Documentation Plan:
Unit tests at multiple levels added to test.
Github PRs/Circle runs:
Trunk: [https://github.com/apache/cassandra/pull/1621]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/18/workflows/d33b2827-b970-4fc2-a56e-4ed68a532005]
[java11_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/18/workflows/4631f123-ffde-4151-833c-ecd0b9378f3f]
4.1: [https://github.com/apache/cassandra/pull/1633]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/19/workflows/deb9a03f-53e5-47be-8f6a-a4e60db6e375]
[java11_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/19/workflows/ca3763ea-bbb9-42c5-bfc7-3291969f04f0]
4.0: [https://github.com/apache/cassandra/pull/1634]
Circle
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/20/workflows/3a596abf-d173-44a2-b172-e7e74aaa9c3e]
[java11_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/20/workflows/a4532032-ef90-42ba-8b13-21b68d0825de]
3.11: [https://github.com/apache/cassandra/pull/1635]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/22/workflows/eb51d3db-c196-4031-acc6-b36deb060dc7]
3.0: [https://github.com/apache/cassandra/pull/1636]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/23/workflows/4f6428c2-a4f9-4bee-80d6-22519f0b5c75]
was:
Unit tests at multiple levels added to test.
Github PRs/Circle runs:
Trunk: [https://github.com/apache/cassandra/pull/1621]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/18/workflows/d33b2827-b970-4fc2-a56e-4ed68a532005]
[java11_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/18/workflows/4631f123-ffde-4151-833c-ecd0b9378f3f]
4.1: [https://github.com/apache/cassandra/pull/1633]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/19/workflows/deb9a03f-53e5-47be-8f6a-a4e60db6e375]
[java11_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/19/workflows/ca3763ea-bbb9-42c5-bfc7-3291969f04f0]
4.0: [https://github.com/apache/cassandra/pull/1634]
Circle
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/20/workflows/3a596abf-d173-44a2-b172-e7e74aaa9c3e]
[java11_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/20/workflows/a4532032-ef90-42ba-8b13-21b68d0825de]
3.11: [https://github.com/apache/cassandra/pull/1635]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/22/workflows/eb51d3db-c196-4031-acc6-b36deb060dc7]
3.0: [https://github.com/apache/cassandra/pull/1636]
Circle:
[java8_tests|https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra/23/workflows/4f6428c2-a4f9-4bee-80d6-22519f0b5c75]
Circle runs can be found at
https://app.circleci.com/pipelines/github/JeetKunDoug/cassandra?filter=all
> Frozen maps may be serialized unsorted, causing inability to query later
> ------------------------------------------------------------------------
>
> Key: CASSANDRA-17623
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17623
> Project: Cassandra
> Issue Type: Bug
> Components: CQL/Semantics
> Reporter: Doug Rohrer
> Assignee: Doug Rohrer
> Priority: Normal
> Fix For: 4.0.x, 4.1-beta, 4.x
>
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> CASSANDRA-7859 introduced the ability to use frozen collections as parts of
> primary keys. This +requires+ all frozen maps to be persisted with their
> entries sorted by the map keys. If the map is +not+ sorted correctly, it
> becomes impossible to project all of the map values out of the map using the
> map projection/selection syntax. For example, the select below would fail if
> the map was not sorted correctly and the higher-valued key was persisted
> first:
> {code:sql}
> CREATE TABLE test.test (k text, c frozen<map<text, text>>, PRIMARY KEY (k,
> c));
> INSERT INTO test.test (k, c) VALUES ('key', {'z':'second_value',
> 'a':'first_value'});
> SELECT k, c['a'] from test.test where k='key' -- c['a'] would return NULL here
> {code}
> Additionally, if you attempted to select just that row by using the complete
> map value in a WHERE clause, which is also supported, it would return no rows
> unless the map provided by the query processor just happened to be sorted the
> same way as the persisted value.
> However, there is a bug in Maps.java where we don't actually use a SortedMap
> in {{Maps.Value#fromSerialized}}, which manifests if a client sends an
> unsorted map as a bound parameter to a query on insert or select. In either
> case, the map may not be sorted correctly, leading to either invalid data
> being persisted to disk (in the INSERT case) or the query not being able to
> be executed/returning 0 rows even though a row _should_ exist (SELECT).
> This bug affects any usage of parameterized queries (tested with the DataStax
> driver, and was originally discovered when using the CQLSSTableWriter code to
> write data locally).
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]