Package org.apache.calcite.sql.validate
Interface SqlNameMatcher
public interface SqlNameMatcher
Checks whether two names are the same according to a case-sensitivity policy.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the most recent match.Creates a set that has the same case-sensitivity as this matcher.distinctCopy
(Iterable<String> names) Returns a copy of a collection, removing duplicates and retaining iteration order.@Nullable RelDataTypeField
field
(RelDataType rowType, String fieldName) Finds a field with a given name, using the current case-sensitivity, returning null if not found.int
Returns how many times a string occurs in a collection.Looks up an item in a map.default int
Returns the index of the first element of a collection that matches.boolean
Returns whether name matching is case-sensitive.boolean
Returns a name matches another.
-
Method Details
-
isCaseSensitive
boolean isCaseSensitive()Returns whether name matching is case-sensitive. -
matches
Returns a name matches another.- Parameters:
string
- Name written in codename
- Name of object we are trying to match- Returns:
- Whether matches
-
get
<K extends List<String>,V> @Nullable V get(Map<K, V> map, List<String> prefixNames, List<String> names) Looks up an item in a map. -
bestString
String bestString()Returns the most recent match.In the default implementation, throws
UnsupportedOperationException
. -
field
Finds a field with a given name, using the current case-sensitivity, returning null if not found.- Parameters:
rowType
- Row typefieldName
- Field name- Returns:
- Field, or null if not found
-
frequency
Returns how many times a string occurs in a collection.Similar to
Collections.frequency(java.util.Collection<?>, java.lang.Object)
. -
distinctCopy
Returns a copy of a collection, removing duplicates and retaining iteration order. -
indexOf
Returns the index of the first element of a collection that matches. -
createSet
Creates a set that has the same case-sensitivity as this matcher.
-