MaxGekk commented on code in PR #40195:
URL: https://github.com/apache/spark/pull/40195#discussion_r1121955732


##########
sql/core/src/test/resources/sql-tests/inputs/interval.sql:
##########
@@ -164,7 +164,6 @@ SELECT interval 'interval 2 weeks 2 days 1 hour 3 minutes 2 
seconds 100 millisec
 SELECT interval '2 weeks 2 days 1 hour 3 minutes 2 seconds 100 millisecond 200 
microseconds';
 
 -- malformed interval literal
-select interval;

Review Comment:
   Could you leave this test, please, and add one more check:
   ```sql
   SELECT interval FROM VALUES ('abc') AS tbl(interval);
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -2758,15 +2758,13 @@ class AstBuilder extends 
SqlBaseParserBaseVisitor[AnyRef] with SQLConfHelper wit
           innerCtx.unitToUnitInterval)
       }
       visitMultiUnitsInterval(innerCtx.multiUnitsInterval)
-    } else if (ctx.errorCapturingUnitToUnitInterval != null) {

Review Comment:
   Could you add the assert in the `else` block, please:
   ```scala
   assert(ctx.errorCapturingUnitToUnitInterval != null)
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to