Package org.apache.calcite.sql.validate
Interface SqlNameMatcher
-
- All Known Implementing Classes:
SqlNameMatchers.BaseMatcher
,SqlNameMatchers.LiberalNameMatcher
public interface SqlNameMatcher
Checks whether two names are the same according to a case-sensitivity policy.- See Also:
SqlNameMatchers
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
bestString()
Returns the most recent match.java.util.Set<java.lang.String>
createSet()
Creates a set that has the same case-sensitivity as this matcher.RelDataTypeField
field(RelDataType rowType, java.lang.String fieldName)
Finds a field with a given name, using the current case-sensitivity, returning null if not found.int
frequency(java.lang.Iterable<java.lang.String> names, java.lang.String name)
Returns how many times a string occurs in a collection.<K extends java.util.List<java.lang.String>,V>
Vget(java.util.Map<K,V> map, java.util.List<java.lang.String> prefixNames, java.util.List<java.lang.String> names)
Looks up an item in a map.boolean
isCaseSensitive()
Returns whether name matching is case-sensitive.boolean
matches(java.lang.String string, java.lang.String name)
Returns a name matches another.
-
-
-
Method Detail
-
isCaseSensitive
boolean isCaseSensitive()
Returns whether name matching is case-sensitive.
-
matches
boolean matches(java.lang.String string, java.lang.String name)
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 java.util.List<java.lang.String>,V> V get(java.util.Map<K,V> map, java.util.List<java.lang.String> prefixNames, java.util.List<java.lang.String> names)
Looks up an item in a map.
-
bestString
java.lang.String bestString()
Returns the most recent match.In the default implementation, throws
UnsupportedOperationException
.
-
field
RelDataTypeField field(RelDataType rowType, java.lang.String fieldName)
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
int frequency(java.lang.Iterable<java.lang.String> names, java.lang.String name)
Returns how many times a string occurs in a collection.Similar to
Collections.frequency(java.util.Collection<?>, java.lang.Object)
.
-
createSet
java.util.Set<java.lang.String> createSet()
Creates a set that has the same case-sensitivity as this matcher.
-
-