vinothchandar commented on a change in pull request #3824:
URL: https://github.com/apache/hudi/pull/3824#discussion_r743793385
##########
File path:
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/HoodieSqlUtils.scala
##########
@@ -292,13 +291,14 @@ object HoodieSqlUtils extends SparkAdapterSupport {
* 3、yyyyMMddHHmmss
*/
def formatQueryInstant(queryInstant: String): String = {
- if (queryInstant.length == 19) { // for yyyy-MM-dd HH:mm:ss
-
HoodieActiveTimeline.COMMIT_FORMATTER.format(defaultDateTimeFormat.parse(queryInstant))
- } else if (queryInstant.length == 14) { // for yyyyMMddHHmmss
- HoodieActiveTimeline.COMMIT_FORMATTER.parse(queryInstant) // validate
the format
+ val instantLength = queryInstant.length
+ if (instantLength == 19 || instantLength == 23) { // for yyyy-MM-dd
HH:mm:ss[:SSS]
+ HoodieActiveTimeline.getInstantForDateString(queryInstant)
+ } else if (instantLength == 14 || instantLength == 17) { // for
yyyyMMddHHmmss[SSS]
Review comment:
nit: should we use the `17`/ instant length, from the constant we have
up above?
--
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]