ygerzhedovich commented on code in PR #1528: URL: https://github.com/apache/ignite-3/pull/1528#discussion_r1081461103
########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java: ########## @@ -459,15 +459,23 @@ private boolean isSystemFieldName(String alias) { /** {@inheritDoc} */ @Override protected void inferUnknownTypes(RelDataType inferredType, SqlValidatorScope scope, SqlNode node) { - if (node instanceof SqlDynamicParam && inferredType.equals(unknownType)) { - Object param = parameters[((SqlDynamicParam) node).getIndex()]; - RelDataType type; - if (param == null) { - type = typeFactory().createSqlType(SqlTypeName.NULL); + if (node instanceof SqlDynamicParam) { + int index = ((SqlDynamicParam) node).getIndex(); + if (index >= parameters.length) { + throw newValidationError(node, RESOURCE.dynamicParamIllegal()); Review Comment: I think we should also throw error in case user pass concrete values more than query has dynamics parameters. And seems it could be done a little bit earlier. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org