danny0405 commented on code in PR #6141:
URL: https://github.com/apache/hudi/pull/6141#discussion_r929614662


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/IncrementalRelation.scala:
##########
@@ -71,6 +71,14 @@ class IncrementalRelation(val sqlContext: SQLContext,
     throw new HoodieException(s"Specify the begin instant time to pull from 
using " +
       s"option ${DataSourceReadOptions.BEGIN_INSTANTTIME.key}")
   }
+
+  if (optParams.contains(DataSourceReadOptions.END_INSTANTTIME.key())) {
+    val startInstantTime = 
optParams(DataSourceReadOptions.BEGIN_INSTANTTIME.key)
+    val endInstantTime = optParams(DataSourceReadOptions.END_INSTANTTIME.key())
+    if (endInstantTime.compareTo(startInstantTime) < 0)
+    throw new HoodieException(s"Specify the begin instant time can not be 
larger than the end instant time")
+  }

Review Comment:
   Should be a valid case to just return empty data set.



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

Reply via email to