TIME_PARSE works correctly if both date and time parts are specified, and a TIME object (that contains only time is returned). Adjust docs and add a unit test that validates the behavior. Follows: #55223
@@ -520,7 +520,7 @@ https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/time/format/Da
If any of the two arguments is `null` or an empty string `null` is returned.
[NOTE]
-If the parsing pattern contains date units (e.g. 'dd/MM/uuuu', 'dd-MM HH:mm:ss', etc.) an error is returned
+If the parsing pattern contains only date units (e.g. 'dd/MM/uuuu') an error is returned
as the function needs to return a value of `time` type which will contain only time.
[source, sql]
@@ -203,5 +203,11 @@ public class DateTimeParseProcessorTests extends AbstractSqlWireSerializingTestC
.asProcessor()
.process(null)
);
+ assertEquals(
+ time(10, 20, 30, 123456789, ZoneOffset.of("+05:30"), zoneId),
+ new TimeParse(Source.EMPTY, l("16/06/2020 10:20:30.123456789 +05:30"), l("dd/MM/uuuu HH:mm:ss.SSSSSSSSS zz"), zoneId).makePipe()
+ .asProcessor()
+ .process(null)
+ );
}