cloud-fan commented on a change in pull request #29708:
URL: https://github.com/apache/spark/pull/29708#discussion_r486151611
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -2132,7 +2134,12 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
val kvs = units.indices.map { i =>
val u = units(i).getText
val v = if (values(i).STRING() != null) {
- string(values(i).STRING())
+ val value = string(values(i).STRING()).trim
+ if (!intervalValStrPattern.matcher(value).matches()) {
Review comment:
ok maybe the first version is better, as we basically just want to avoid
the `value` string to contain unit. `value.exists(Character.isLetter)` should
be good enough.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]