This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit e8213fe3d2683d64a72b1d3bac6a28607633b625 Merge: c21a871 c911737 Author: Stephen Mallette <[email protected]> AuthorDate: Thu Sep 23 07:46:08 2021 -0400 Merge branch '3.5-dev' CHANGELOG.asciidoc | 1 + docs/src/reference/gremlin-variants.asciidoc | 12 +++ docs/src/reference/the-traversal.asciidoc | 5 + docs/src/upgrade/release-3.5.x.asciidoc | 34 +++++- .../tinkerpop/gremlin/jsr223/CoreImports.java | 6 ++ .../language/grammar/GenericLiteralVisitor.java | 9 ++ .../traversal/translator/GroovyTranslator.java | 29 ++++++ .../tinkerpop/gremlin/util/DatetimeHelper.java | 116 +++++++++++++++++++++ .../grammar/GeneralLiteralVisitorTest.java | 44 ++++++++ .../traversal/translator/GroovyTranslatorTest.java | 13 +++ .../tinkerpop/gremlin/util/DatetimeHelperTest.java | 103 ++++++++++++++++++ .../server/GremlinServerHttpIntegrateTest.java | 14 +++ 12 files changed, 385 insertions(+), 1 deletion(-) diff --cc docs/src/upgrade/release-3.5.x.asciidoc index 3c72a4b,ca3bf36..3f233ca --- a/docs/src/upgrade/release-3.5.x.asciidoc +++ b/docs/src/upgrade/release-3.5.x.asciidoc @@@ -30,16 -30,36 +30,48 @@@ complete list of all the modifications === Upgrading for Users - ==== Changes to default values + ==== datetime() + + Gremlin in native programming languages can all construct a native date and time object. In Java, that would probably + be a `java.util.Date` object while in Javascript it would likely be the Node.js `Date`. In any of these cases, these + native objects would be serialized to millisecond-precision offset from the unix epoch to be sent over the wire to the + server (in embedded mode for Java, it would be up to the graph database to determine how the date is handled). + + The gap is in Gremlin scripts which do not have a way to natively construct dates and times other than by using Groovy + variants. As TinkerPop moves toward a more secure method of processing Gremlin scripts by way of the `gremlin-language` + model, it was clear that this gap needed to be filled. The new `datetime()` function can take a ISO-8601 formatted + datetime and internally produce a `Date` with a default time zone offset of UTC (+00:00). + + This functionality, while syntax of `gremlin-language`, is also exposed as a component of `gremlin-groovy` so that it + can be used in the Gremlin Console and through the `GremlinScriptEngine` in Gremlin Server. + + [source,text] + ---- + gremlin> datetime('2022-10-02').toGMTString() + ==>2 Oct 2022 00:00:00 GMT + gremlin> datetime('2022-10-02T00:00:00Z').toGMTString() + ==>2 Oct 2022 00:00:00 GMT + gremlin> datetime('2022-10-02T00:00:00-0400').toGMTString() + ==>2 Oct 2022 04:00:00 GMT + ---- + + The above examples use the Java `Date` method `toGMTString()` to properly format the date for demonstration purposes. + From a Gremlin language perspective there are no functions that can be called on the return value of `datetime()`. + -See:link:https://issues.apache.org/jira/browse/TINKERPOP-2596[TINKERPOP-2596] ++See: link:https://issues.apache.org/jira/browse/TINKERPOP-2596[TINKERPOP-2596] ++ ++==== Driver Defaults + +Some default value settings were changed to be consistent across different languages. + +* The default for `PoolSize` is now `8` instead of `4` in .NET. +* The default for `MaxInProcessPerConnection` is now `32` instead of `16` in .NET. +* The default for `maxContentLength` is now 10 mb in the Java builder instead of 65536. +* The default for `pool_size` is now `8` instead of `4` in Python. +* If a `protocol_factory` is not specified, it now adheres to the `max_content_length` specified instead of always using 65536 in Python. + ++See: link:https://issues.apache.org/jira/browse/TINKERPOP-2379[TINKERPOP-2379] + ==== Refinements to null Release 3.5.0 introduce the ability for there to be traversers that contained a `null` value. Since that time it has
