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

Literals should be valid selectors in SELECT statements

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Low
    • Resolution: Duplicate
    • Fix Version/s: 3.11.5
    • Component/s: None
    • Labels:
      None

      Description

      Literals are currently not acceptable selectors in SELECT statements:

      <selector> ::= <identifier>
                   | WRITETIME '(' <identifier> ')'
                   | TTL '(' <identifier> ')'
                   | <function> '(' (<selector> (',' <selector>)*)? ')'
      

      This wasn't a big deal up to now as it wasn't very useful for users, but with UDFs being added in Cassandra 3.0, this means that literals aren't valid parameters of function. I believe it would actually be useful for several use cases:

      • To allow developers to test their own functions without having to set a value to a column to then pass it as an argument to the function.
      • To make it possible to write function that require a constant parameter such as pow(int, int) -> int or contains(set<text>, text) -> boolean.

      Additionally, this limitation is an inconsistency as literals are allowed in functions when used in INSERT statements.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mfiguiere Michaël Figuière
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: