Class Selectable.WithMapOrUdt
- java.lang.Object
-
- org.apache.cassandra.cql3.selection.Selectable.WithMapOrUdt
-
- All Implemented Interfaces:
AssignmentTestable,Selectable
- Enclosing interface:
- Selectable
public static class Selectable.WithMapOrUdt extends java.lang.Object implements Selectable
Selectablefor literal Maps or UDTs.The parser cannot differentiate between a Map or a UDT in the selection cause because a
ColumnIdentifieris equivalent to aFieldIdentifierfrom a syntax point of view. By consequence, we are forced to wait until the type is known to be able to differentiate them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSelectable.WithMapOrUdt.Raw-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.selection.Selectable
Selectable.BetweenParenthesesOrWithTuple, Selectable.RawIdentifier, Selectable.WithCast, Selectable.WithElementSelection, Selectable.WithFieldSelection, Selectable.WithFunction, Selectable.WithList, Selectable.WithMapOrUdt, Selectable.WithSet, Selectable.WithSliceSelection, Selectable.WithTerm, Selectable.WithToJSonFunction, Selectable.WithTypeHint, Selectable.WritetimeOrTTL
-
-
Constructor Summary
Constructors Constructor Description WithMapOrUdt(TableMetadata cfm, java.util.List<Pair<Selectable.Raw,Selectable.Raw>> raws)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractType<?>getExactTypeIfKnown(java.lang.String keyspace)The type of theSelectableif it can be infered.Selector.FactorynewSelectorFactory(TableMetadata cfm, AbstractType<?> expectedType, java.util.List<ColumnMetadata> defs, VariableSpecifications boundNames)booleanselectColumns(java.util.function.Predicate<ColumnMetadata> predicate)Checks if thisSelectableselect columns matching the specified predicate.AssignmentTestable.TestResulttestAssignment(java.lang.String keyspace, ColumnSpecification receiver)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.selection.Selectable
addAndGetIndex, processesSelection, specForElementOrSlice
-
-
-
-
Constructor Detail
-
WithMapOrUdt
public WithMapOrUdt(TableMetadata cfm, java.util.List<Pair<Selectable.Raw,Selectable.Raw>> raws)
-
-
Method Detail
-
testAssignment
public AssignmentTestable.TestResult testAssignment(java.lang.String keyspace, ColumnSpecification receiver)
- Specified by:
testAssignmentin interfaceAssignmentTestable- Specified by:
testAssignmentin interfaceSelectable- 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, java.util.List<ColumnMetadata> defs, VariableSpecifications boundNames)
- Specified by:
newSelectorFactoryin interfaceSelectable
-
getExactTypeIfKnown
public AbstractType<?> getExactTypeIfKnown(java.lang.String keyspace)
Description copied from interface:SelectableThe type of theSelectableif it can be infered.- Specified by:
getExactTypeIfKnownin interfaceSelectable- Parameters:
keyspace- the keyspace on which the statement for which this is aSelectableis on.- Returns:
- the type of this
Selectableif inferrable, ornullotherwise (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 returnnulltoo).
-
selectColumns
public boolean selectColumns(java.util.function.Predicate<ColumnMetadata> predicate)
Description copied from interface:SelectableChecks if thisSelectableselect columns matching the specified predicate.- Specified by:
selectColumnsin interfaceSelectable- Returns:
trueif thisSelectableselect columns matching the specified predicate,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-