Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update IntervalUtils.scala
  • Loading branch information
AngersZhuuuu committed May 7, 2021
commit 3e7fb54768c6d7e1496edc5d0780f60eb8ade6f9
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object IntervalUtils {
result
}

private val unquotedYearMonthRegex = "([+|-])?(\\d+)-(\\d+)".r
private val unquotedYearMonthRegex = "([+|-])?(\\d+)-(\\d+)"
private val quotedYearMonthPattern = (s"^$unquotedYearMonthRegex$$").r
Copy link
Contributor

@cloud-fan cloud-fan May 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see what "quoted" means here...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see what "quoted" means here...

he may want to mean it without ^ and $

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not quoted. To me it's more like regex string vs compiled regex.

How about yearMonthPatternString, yearMonthRegex and yearMontnLiteralRegex?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good, done

private val yearMonthLiteralPattern =
(s"(?i)^INTERVAL\\s+([+|-])?'$unquotedYearMonthRegex'\\s+YEAR\\s+TO\\s+MONTH$$").r
Expand Down