You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Muhammad Gelbana (JIRA)" <ji...@apache.org> on 2019/03/07 12:24:00 UTC
[jira] [Created] (CALCITE-2901) RexSubQuery.scalar needs to allow
specifying a different nullability value instead of the hard coded "true"
value
Muhammad Gelbana created CALCITE-2901:
-----------------------------------------
Summary: RexSubQuery.scalar needs to allow specifying a different nullability value instead of the hard coded "true" value
Key: CALCITE-2901
URL: https://issues.apache.org/jira/browse/CALCITE-2901
Project: Calcite
Issue Type: Improvement
Components: core
Affects Versions: 1.18.0
Reporter: Muhammad Gelbana
The RexSubQuery.scalar(RelNode rel) method creates a subquery node with a hard coded nullability value of *true*, which might not be always valid.
{code:java}
public static RexSubQuery scalar(RelNode rel) {
final List<RelDataTypeField> fieldList = rel.getRowType().getFieldList();
assert fieldList.size() == 1;
final RelDataTypeFactory typeFactory = rel.getCluster().getTypeFactory();
final RelDataType type =
typeFactory.createTypeWithNullability(fieldList.get(0).getType(), true);
return new RexSubQuery(type, SqlStdOperatorTable.SCALAR_QUERY,
ImmutableList.of(), rel);
}
{code}
I prupose a slight change which is to update the method's signature to accept a boolean flag to specify the nullability of the subquery's type. Alongside an overloading method calls the modified one with the hard coded *true* nullability for backward compatibility.
Please tell me if such change is acceptable so I can do it.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)