You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jf...@apache.org on 2018/11/16 19:27:43 UTC

[incubator-pinot] branch minor-deserialization-fixes created (now 2d49eb2)

This is an automated email from the ASF dual-hosted git repository.

jfim pushed a change to branch minor-deserialization-fixes
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 2d49eb2  Minor deserialization fixes

This branch includes the following new commits:

     new 2d49eb2  Minor deserialization fixes

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[incubator-pinot] 01/01: Minor deserialization fixes

Posted by jf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jfim pushed a commit to branch minor-deserialization-fixes
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 2d49eb20b7a9021672fc578b5df404253ea4e1e0
Author: Jean-Francois Im <je...@gmail.com>
AuthorDate: Thu Nov 15 12:49:16 2018 -0800

    Minor deserialization fixes
    
    - Add a missing conversion from ArrayList to Set
    - Avoid an NPE from being thrown during value injection. The injection
      behavior stays the same, this just removes the NPE.
---
 .../java/com/linkedin/pinot/common/config/Deserializer.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java b/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java
index 05ccba5..c667366 100644
--- a/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java
+++ b/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java
@@ -159,6 +159,11 @@ public class Deserializer {
       return list;
     });
 
+    typeConverters.put(Tuple.of(ArrayList.class, Set.class), items -> {
+      ArrayList list = (ArrayList) items;
+      return new HashSet(list);
+    });
+
     // Mark all types that have a converter as simple types
     simpleTypes = new HashSet<>();
     typeConverters
@@ -232,7 +237,10 @@ public class Deserializer {
 
               LOGGER.debug("Extracting value from field {} of {}, values are {}", dslInfo.value(), dslValue, dslValues);
 
-              valueInjected |= coerceValueIntoField(rootObject, declaredField, dslValues.getOrElse(dslInfo.value(), null));
+              if (dslValues != null) {
+                valueInjected |=
+                    coerceValueIntoField(rootObject, declaredField, dslValues.getOrElse(dslInfo.value(), null));
+              }
             }
           } else if (useChildKeyHandler != null) {
             // Use a child key handler to handle this value


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org