You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "David Capwell (Jira)" <ji...@apache.org> on 2022/09/21 23:01:00 UTC
[jira] [Updated] (CASSANDRA-17915) Confusing error message when using ? with functions
[ https://issues.apache.org/jira/browse/CASSANDRA-17915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Capwell updated CASSANDRA-17915:
--------------------------------------
Change Category: Operability
Complexity: Low Hanging Fruit
Status: Open (was: Triage Needed)
> Confusing error message when using ? with functions
> ---------------------------------------------------
>
> Key: CASSANDRA-17915
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17915
> Project: Cassandra
> Issue Type: Improvement
> Components: CQL/Interpreter
> Reporter: David Capwell
> Priority: Normal
>
> {code}
> INSERT INTO %S (a, b, c) VALUES (? + 1, ?, ?)
> {code}
> Errors saying
> {code}
> Ambiguous '+' operation with args ? and 1: use type casts to disambiguate
> {code}
> Now, if you google “type casts CQL” you get https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/refCqlFunction.html which says to do
> {code}
> CAST( selector AS to_type )
> {code}
> But this also fails!
> {code}
> InvalidRequestException: Ambiguous call to function system.castAsFloat (can be matched by following signatures: system."castAsFloat" : (bigint) -> float, system."castAsFloat" : (counter) -> float, system."castAsFloat" : (double) -> float, system."castAsFloat" : (int) -> float, system."castAsFloat" : (tinyint) -> float, system."castAsFloat" : (varint) -> float, system."castAsFloat" : (decimal) -> float, system."castAsFloat" : (smallint) -> float): use type casts to disambiguate
> {code}
> What we have to do is
> {code}
> INSERT INTO %S (a, b, c) VALUES ((int) ? + 1, ?, ?)
> {code}
> We should improve the error message to show the expected syntax (or fix CAST to work in this case).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org