Class Selectable.BetweenParenthesesOrWithTuple

java.lang.Object
org.apache.cassandra.cql3.selection.Selectable.BetweenParenthesesOrWithTuple
All Implemented Interfaces:
AssignmentTestable, Selectable
Enclosing interface:
Selectable

public static class Selectable.BetweenParenthesesOrWithTuple extends Object implements Selectable
Selectable for Selectable between parentheses or tuples.

The parser cannot differentiate between a single element between parentheses or a single element tuple. By consequence, we are forced to wait until the type is known to be able to differentiate them.

  • Constructor Details

    • BetweenParenthesesOrWithTuple

      public BetweenParenthesesOrWithTuple(List<Selectable> selectables)
  • Method Details

    • testAssignment

      public AssignmentTestable.TestResult testAssignment(String keyspace, ColumnSpecification receiver)
      Specified by:
      testAssignment in interface AssignmentTestable
      Specified by:
      testAssignment in interface Selectable
      Returns:
      whether this object can be assigned to the provided receiver. We distinguish between 3 values: - EXACT_MATCH if this object is exactly of the type expected by the receiver - WEAKLY_ASSIGNABLE if this object is not exactly the expected type but is assignable nonetheless - NOT_ASSIGNABLE if it's not assignable Most caller should just call the isAssignable() method on the result, though functions have a use for testing "strong" equality to decide the most precise overload to pick when multiple could match.
    • newSelectorFactory

      public Selector.Factory newSelectorFactory(TableMetadata cfm, AbstractType<?> expectedType, List<ColumnMetadata> defs, VariableSpecifications boundNames)
      Specified by:
      newSelectorFactory in interface Selectable
    • getExactTypeIfKnown

      public AbstractType<?> getExactTypeIfKnown(String keyspace)
      Description copied from interface: Selectable
      The type of the Selectable if it can be infered.
      Specified by:
      getExactTypeIfKnown in interface Selectable
      Parameters:
      keyspace - the keyspace on which the statement for which this is a Selectable is on.
      Returns:
      the type of this Selectable if inferrable, or null otherwise (for instance, the type isn't inferable for a bind marker. Even for literals, the exact type is not inferrable since they are valid for many different types and so this will return null too).
    • getCompatibleTypeIfKnown

      public AbstractType<?> getCompatibleTypeIfKnown(String keyspace)
      Specified by:
      getCompatibleTypeIfKnown in interface AssignmentTestable
      Specified by:
      getCompatibleTypeIfKnown in interface Selectable
      Returns:
      A data type that can represent this, or null if we can't determine that type. The returned type won't necessarely be the exact type, but one that is compatible with it.
    • selectColumns

      public boolean selectColumns(Predicate<ColumnMetadata> predicate)
      Description copied from interface: Selectable
      Checks if this Selectable select columns matching the specified predicate.
      Specified by:
      selectColumns in interface Selectable
      Returns:
      true if this Selectable select columns matching the specified predicate, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object