You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/01/26 02:29:00 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #2326: [CALCITE-4265] Improve error message when CAST to unknown type (Louis

danny0405 commented on a change in pull request #2326:
URL: https://github.com/apache/calcite/pull/2326#discussion_r564175002



##########
File path: core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
##########
@@ -1759,6 +1759,9 @@ protected SqlSelect createSourceSelectForDelete(SqlDelete call) {
   @Override public RelDataType getValidatedNodeType(SqlNode node) {
     RelDataType type = getValidatedNodeTypeIfKnown(node);
     if (type == null) {
+      if (node.isA(ImmutableSet.of(SqlKind.IDENTIFIER))) {
+        throw newValidationError(node, RESOURCE.unknownIdentifier(node.toString()));

Review comment:
       How about using `node.getKind() == SqlKind.IDENTIFIER` ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org