gengliangwang commented on a change in pull request #27716: 
[SPARK-30964][Core][WebUI] Accelerate InMemoryStore with a new index
URL: https://github.com/apache/spark/pull/27716#discussion_r385999668
 
 

 ##########
 File path: 
common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java
 ##########
 @@ -322,15 +374,32 @@ private static Object 
indexValueForEntity(KVTypeInfo.Accessor getter, Object ent
      */
     private List<T> copyElements() {
       if (parent != null) {
-        KVTypeInfo.Accessor parentGetter = ti.getParentAccessor(index);
-        Preconditions.checkArgument(parentGetter != null, "Parent filter for 
non-child index.");
-        Comparable<?> parentKey = asKey(parent);
-
-        return elements.stream()
-          .filter(e -> compare(e, parentGetter, parentKey) == 0)
-          .collect(Collectors.toList());
+        Comparable<Object> parentKey = asKey(parent);
+        if (!naturalParentIndexName.isEmpty() &&
+          naturalParentIndexName.equals(ti.getParentIndexName(index))) {
 
 Review comment:
   It is possible.  I have explained in 
https://github.com/apache/spark/pull/27716/files#r385846069. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to