[ https://issues.apache.org/jira/browse/CASSANDRA-17133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17456834#comment-17456834 ]
Kanthi Subramanian edited comment on CASSANDRA-17133 at 12/10/21, 1:32 AM: --------------------------------------------------------------------------- [~brandon.williams] , I made the same change in the unit tests too, please see here, because support for bigint was added to maxTimeuuid, the logic of picking the right function throws the ambiguous error. Its quite possible the user will encounter this, but I assumed its fine because the other functions work the same way. [https://github.com/apache/cassandra/pull/1275/files] {code:java} -- assertEmpty(execute("SELECT t FROM %s WHERE k = 0 AND t > maxTimeuuid(1234567) AND t < minTimeuuid('2012-11-07 18:18:22-0800')")); ++ assertEmpty(execute("SELECT t FROM %s WHERE k = 0 AND t > maxTimeuuid(1564830182000) AND t < minTimeuuid('2012-11-07 18:18:22-0800')")); {code} The reason is this logic here, Because bigint and timestamp gets the WEAKLY_ASSIGNABLE when the parameter is integer. https://issues.apache.org/jira/browse/CASSANDRA-17029 {code:java} case INTEGER: // code placeholdercase INTEGER: switch (nt) { case BIGINT: case COUNTER: case DATE: case DECIMAL: case DOUBLE: case DURATION: case FLOAT: case INT: case SMALLINT: case TIME: case TIMESTAMP: case TINYINT: case VARINT: return AssignmentTestable.TestResult.WEAKLY_ASSIGNABLE; {code} The tounixtimestamp function which wasnt changed as part of this PR also has the same problem. {code:java} // code placeholder select toUnixTimestamp(123) from emp; InvalidRequest: Error from server: code=2200 [Invalid query] message="Ambiguous call to function tounixtimestamp (can be matched by following signatures: system.tounixtimestamp : (timestamp) -> bigint, system.tounixtimestamp : (date) -> bigint): use type casts to disambiguate" {code} It will definitely be great if we can check for int and cast to bigint, but not sure where it can be done because the testAssignment function is first called. was (Author: subkanthi): [~brandon.williams] , I made the same change in the unit tests too, please see here, because support for bigint was added to maxTimeuuid, the logic of picking the right function throws the ambiguous error. Its quite possible the user will encounter this, but I assumed that the other functions work the same way. [https://github.com/apache/cassandra/pull/1275/files] {code:java} -- assertEmpty(execute("SELECT t FROM %s WHERE k = 0 AND t > maxTimeuuid(1234567) AND t < minTimeuuid('2012-11-07 18:18:22-0800')")); ++ assertEmpty(execute("SELECT t FROM %s WHERE k = 0 AND t > maxTimeuuid(1564830182000) AND t < minTimeuuid('2012-11-07 18:18:22-0800')")); {code} The reason is this logic here, Because bigint and timestamp gets the WEAKLY_ASSIGNABLE when the parameter is integer. https://issues.apache.org/jira/browse/CASSANDRA-17029 {code:java} case INTEGER: // code placeholdercase INTEGER: switch (nt) { case BIGINT: case COUNTER: case DATE: case DECIMAL: case DOUBLE: case DURATION: case FLOAT: case INT: case SMALLINT: case TIME: case TIMESTAMP: case TINYINT: case VARINT: return AssignmentTestable.TestResult.WEAKLY_ASSIGNABLE; {code} The tounixtimestamp function which wasnt changed as part of this PR also has the same problem. {code:java} // code placeholder select toUnixTimestamp(123) from emp; InvalidRequest: Error from server: code=2200 [Invalid query] message="Ambiguous call to function tounixtimestamp (can be matched by following signatures: system.tounixtimestamp : (timestamp) -> bigint, system.tounixtimestamp : (date) -> bigint): use type casts to disambiguate" {code} It will definitely be great if we can check for int and cast to bigint, but not sure where it can be done because the testAssignment function is first called. > Broken test_timeuuid - upgrade_tests.cql_tests > ---------------------------------------------- > > Key: CASSANDRA-17133 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17133 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics > Reporter: Yifan Cai > Assignee: Kanthi Subramanian > Priority: Normal > Fix For: 4.x > > > Both CircleCI and Jenkins build failed at test_timeuuid with the following > error. > {quote}cassandra.InvalidRequest: Error from server: code=2200 [Invalid query] > message="Ambiguous call to function maxtimeuuid (can be matched by following > signatures: system.maxtimeuuid : (bigint) -> timeuuid, system.maxtimeuuid : > (timestamp) -> timeuuid): use type casts to disambiguate"{quote} > https://app.circleci.com/pipelines/github/yifan-c/cassandra/273/workflows/7a855174-823a-4553-ad09-25623747a58e/jobs/1884/tests#failed-test-0 > https://ci-cassandra.apache.org/blue/organizations/jenkins/Cassandra-devbranch/detail/Cassandra-devbranch/1272/tests/ > The change was added in CASSANDRA-17029. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org