[ 
https://issues.apache.org/jira/browse/CASSANDRA-18652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17741137#comment-17741137
 ] 

Andres de la Peña commented on CASSANDRA-18652:
-----------------------------------------------

Thanks for the review :)

I usually add the {{CHANGES.txt}} entry on commit to ease rebase and not show 
trivial merge conflicts on the PR. Re-running 
{{{}j11_cqlshlib_cython_tests{}}}: 
[https://app.circleci.com/pipelines/github/adelapena/cassandra/3007/workflows/64c75a2d-ee19-436a-bc9f-7b930d2d32fe]

> Improve vector value validation errors
> --------------------------------------
>
>                 Key: CASSANDRA-18652
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18652
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Cluster/Schema
>            Reporter: Andres de la Peña
>            Assignee: Andres de la Peña
>            Priority: Normal
>             Fix For: 5.x
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Some of the error messages shown when trying to bind a vector column with a 
> wrong value are a bit obscure. For example, if we try to write a value with 
> the wrong number of dimensions:
> {code}
> createTable("CREATE TABLE %s (pk int primary key, value vector<int, 2>)");
> execute("INSERT INTO %s (pk, value) VALUES (0, ?)", vector(1));
> {code}
>  The error is:
> {code}
> java.lang.IndexOutOfBoundsException: Attempted to read 4, but the size is 0
> {code}
> I understand that we cannot provide a lot of information about a 
> non-understandable bind value, since we don't even know whether it's a vector 
> or something entirely different. But we could try to improve it a bit and 
> throw a {{MarshalException}} that will be translated to a 
> {{InvalidRequestException}}, and provide generic messages similar to those 
> used by collections:
> {code}
> InvalidRequestException: Not enough bytes to read a vector<int, 2>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to