Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11946

Use the return type when resolving function on ambiguous calls

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Duplicate
    • None
    • Legacy/CQL
    • None

    Description

      Currently, when we have multiple overloads of a function we only use the argument to try to resolve the function. When that resolution is ambiguous, we currently throw an error, but in many case (in the WHERE clause at least) we know which type the result is supposed to be so we could use that information to try to disambiguate.

      The main use case I'm thinking of is the now() function. Currently, we have it only for timeuuid. But we should likely provide the equivalent for other time-base types (timestamp, date and time). Except that currently we'd have to use other names that now and that would probably be a bit ugly. If we implement what's above, we'll be able to have overloads of now() for all date types and in many case it'll work how users want out of the bose (that is, WHERE t = now() will work whatever date-based type t is). And in the cases where you can't disambiguate, having to do (time)now() is not really worth than if we had a timeNow() function specific to the time type.

      Also, in principle the change is just a few lines of code.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              slebresne Sylvain Lebresne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: