You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/03/30 20:33:54 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #6622: ISSUE-6612 FIX: parse long field in GenricJsonRecord (#6612)

sijie commented on a change in pull request #6622: ISSUE-6612 FIX: parse long field in GenricJsonRecord (#6612)
URL: https://github.com/apache/pulsar/pull/6622#discussion_r400476292
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java
 ##########
 @@ -55,12 +55,8 @@ public Object getField(String fieldName) {
             return new GenericJsonRecord(schemaVersion, fields, fn);
         } else if (fn.isBoolean()) {
             return fn.asBoolean();
-        } else if (fn.isInt()) {
-            return fn.asInt();
-        } else if (fn.isFloatingPointNumber()) {
-            return fn.asDouble();
-        } else if (fn.isDouble()) {
-            return fn.asDouble();
+        } else if (fn.isNumber()) {
 
 Review comment:
   I think the integration tests failed due to this change.
   
   I think we should keep the original behavior and add the following 
   
   ```
   else if (fn.isLong()) {
       return fn.asLong();
   } else if (fn.isNumber()) {
       return fn.numberValue();
   }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services