alex-plekhanov commented on code in PR #11606:
URL: https://github.com/apache/ignite/pull/11606#discussion_r1814973803
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgniteSqlValidator.java:
##########
@@ -524,15 +524,19 @@ private boolean isSystemFieldName(String alias) {
/** {@inheritDoc} */
@Override protected void inferUnknownTypes(RelDataType inferredType,
SqlValidatorScope scope, SqlNode node) {
- if (node instanceof SqlDynamicParam &&
inferredType.equals(unknownType)) {
- if (parameters.length > ((SqlDynamicParam)node).getIndex()) {
- Object param = parameters[((SqlDynamicParam)node).getIndex()];
+ if (node instanceof SqlDynamicParam ) {
+ if (inferredType.equals(unknownType)) {
+ if (parameters.length > ((SqlDynamicParam)node).getIndex()) {
+ Object param =
parameters[((SqlDynamicParam)node).getIndex()];
- setValidatedNodeType(node, (param == null) ?
typeFactory().createSqlType(SqlTypeName.NULL) :
-
typeFactory().toSql(typeFactory().createType(param.getClass())));
+ setValidatedNodeType(node, (param == null) ?
typeFactory().createSqlType(SqlTypeName.NULL) :
Review Comment:
Planning is a resource consuming process, types caching during planning does
not give any performance boost. I don't know why, but types are not cached in
Calcite anywhere. On the other hand we cache it during execution (see
ExpressionFactoryImpl#nullType), since it's more critical here.
--
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]