xiazcy commented on code in PR #3401:
URL: https://github.com/apache/tinkerpop/pull/3401#discussion_r3171365907


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java:
##########
@@ -346,6 +347,35 @@ public Void visitUuidLiteral(final 
GremlinParser.UuidLiteralContext ctx) {
         return null;
     }
 
+    @Override
+    public Void visitCharacterLiteral(final 
GremlinParser.CharacterLiteralContext ctx) {
+        throw new TranslatorException("Character literals are not supported in 
Go");
+    }
+
+    @Override
+    public Void visitDurationLiteral(final 
GremlinParser.DurationLiteralContext ctx) {
+        final long seconds = Long.parseLong(ctx.integerLiteral(0).getText());
+        final int nanos = Integer.parseInt(ctx.integerLiteral(1).getText());
+        final boolean isPositive = ctx.booleanLiteral() == null ||
+                Boolean.parseBoolean(ctx.booleanLiteral().getText());
+        final long totalNanos = seconds * 1_000_000_000L + nanos;

Review Comment:
   Looks like you used BigInt in the JS translator for Go, i.e.:
   
   > // Use BigInt to avoid precision loss for durations over ~104 days
   >         const totalNanos = BigInt(seconds) * 1_000_000_000n + 
BigInt(nanos);
   
   Should the Java translator here also use BigInt for the same reason?



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