dssysolyatin commented on code in PR #4572:
URL: https://github.com/apache/calcite/pull/4572#discussion_r2416249809
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java:
##########
@@ -1141,16 +1138,21 @@ public Result visit(TableModify modify) {
return result(sqlInsert, ImmutableList.of(), modify, null);
}
case UPDATE: {
+ final List<String> updateColumnList =
+ requireNonNull(modify.getUpdateColumnList(),
+ () -> "modify.getUpdateColumnList() is null for " + modify);
final Result input = visitInput(modify, 0);
+ final SqlSelect sourceSelect = input.asSelect();
+ final SqlNodeList expressionList = sourceSelect.getSelectList()
Review Comment:
Yes, it is not good. Logic of `RelToSqlConverter` should not depend on logic
of `ValidationImpl`. Fixed
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java:
##########
@@ -1141,16 +1138,21 @@ public Result visit(TableModify modify) {
return result(sqlInsert, ImmutableList.of(), modify, null);
}
case UPDATE: {
+ final List<String> updateColumnList =
+ requireNonNull(modify.getUpdateColumnList(),
+ () -> "modify.getUpdateColumnList() is null for " + modify);
final Result input = visitInput(modify, 0);
+ final SqlSelect sourceSelect = input.asSelect();
+ final SqlNodeList expressionList = sourceSelect.getSelectList()
Review Comment:
Yes, it is not good. Logic of `RelToSqlConverter` should not depend on logic
of `ValidatorImpl`. Fixed
--
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]