alex-plekhanov commented on code in PR #4458:
URL: https://github.com/apache/calcite/pull/4458#discussion_r2190390412
##########
core/src/main/java/org/apache/calcite/sql/SqlCollectionTypeNameSpec.java:
##########
@@ -58,32 +58,51 @@
*/
public class SqlCollectionTypeNameSpec extends SqlTypeNameSpec {
private final SqlTypeNameSpec elementTypeName;
+ private final boolean elementTypeNullable;
private final SqlTypeName collectionTypeName;
/**
* Creates a {@code SqlCollectionTypeNameSpec}.
*
* @param elementTypeName Type of the collection element
+ * @param elementTypeNullable Type of the collection element is nullable
* @param collectionTypeName Collection type name
* @param pos Parser position, must not be null
*/
public SqlCollectionTypeNameSpec(SqlTypeNameSpec elementTypeName,
+ boolean elementTypeNullable,
SqlTypeName collectionTypeName,
SqlParserPos pos) {
super(new SqlIdentifier(collectionTypeName.name(), pos), pos);
this.elementTypeName = requireNonNull(elementTypeName, "elementTypeName");
+ this.elementTypeNullable = elementTypeNullable;
this.collectionTypeName =
requireNonNull(collectionTypeName, "collectionTypeName");
}
+ /**
+ * Creates a {@code SqlCollectionTypeNameSpec}.
+ *
+ * @param elementTypeName Type of the collection element
+ * @param collectionTypeName Collection type name
+ * @param pos Parser position, must not be null
+ */
+ public SqlCollectionTypeNameSpec(SqlTypeNameSpec elementTypeName,
+ SqlTypeName collectionTypeName,
+ SqlParserPos pos) {
+ this(elementTypeName, true, collectionTypeName, pos);
+ }
+
public SqlTypeNameSpec getElementTypeName() {
return elementTypeName;
}
@Override public RelDataType deriveType(SqlValidator validator) {
RelDataType type = elementTypeName.deriveType(validator);
// We have to assume that elements may be nullable
Review Comment:
What's wrong with this comment? For me it still looks valid.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]