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 (cherry picked from commit 9d6b679a5da88f3c131b9bdba49aa92c6c272abe)
This commit is contained in:
parent
3b511fd829
commit
50b391e91b
|
@ -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 +0530"), l("dd/MM/uuuu HH:mm:ss.SSSSSSSSS xx"), zoneId).makePipe()
|
||||
.asProcessor()
|
||||
.process(null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue