Class FlinkSqlNameMatcher
java.lang.Object
org.apache.flink.table.planner.calcite.FlinkSqlNameMatcher
- All Implemented Interfaces:
org.apache.calcite.sql.validate.SqlNameMatcher
public class FlinkSqlNameMatcher
extends Object
implements org.apache.calcite.sql.validate.SqlNameMatcher
A workaround for adjusting types of ROW nested fields.
The SqlNameMatcher is used in SqlValidatorImpl when deriving a type of a
nested field of a Table. E.g SELECT `row`.`nested` FROM table. See field(RelDataType, String) for more information.
-
Constructor Summary
ConstructorsConstructorDescriptionFlinkSqlNameMatcher(org.apache.calcite.sql.validate.SqlNameMatcher baseMatcher, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.calcite.rel.type.RelDataTypeFieldCompared to the original method we adjust the nullability of the nested column based on the nullability of the enclosing type.intbooleanbooleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.validate.SqlNameMatcher
distinctCopy, indexOf
-
Constructor Details
-
FlinkSqlNameMatcher
public FlinkSqlNameMatcher(org.apache.calcite.sql.validate.SqlNameMatcher baseMatcher, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory)
-
-
Method Details
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitivein interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-
matches
- Specified by:
matchesin interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-
get
public <K extends List<String>,V> V get(Map<K, V> map, List<String> prefixNames, List<String> names) - Specified by:
getin interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-
bestString
- Specified by:
bestStringin interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-
field
public org.apache.calcite.rel.type.RelDataTypeField field(org.apache.calcite.rel.type.RelDataType rowType, String fieldName) Compared to the original method we adjust the nullability of the nested column based on the nullability of the enclosing type.If the fields type is NOT NULL, but the enclosing ROW is nullable we still can produce nulls.
- Specified by:
fieldin interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-
frequency
- Specified by:
frequencyin interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-
createSet
- Specified by:
createSetin interfaceorg.apache.calcite.sql.validate.SqlNameMatcher
-