how to filter a JavaRDD using a List using java

Masterbuilder

I have a JavaRDD with some json documents, I want to filter the JavaRDD based on a list of ID's in a ArrayList, basically want to get all the documents in the JavaRDD which has the ID which is in the ArrayList. I know this can be done easily on DataSet but not sure how to do it with JavaRDD

Alex Savitsky
javaRdd.filter(json -> arrayList.contains(json.get("id")))

That's a high-level snippet, with json being what's stored in each row of your RDD (I'm not sure what kind of structure is there and how JSON is represented), arrayList is your list of IDs, and json.get("id") just denotes some way of obtaining the ID from your JSON - again, without more info it's hard to be more specific

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to filter list using angularjs

From Dev

How to filter a List using Java 8 stream and startwith array of values

From Dev

How to filter Map by a List using Java 8 stream?

From Dev

How to convert List to JavaRDD

From Dev

Filter list of objects without using hashmap java

From Java

using Java 8 How to filter by list and group by based on filter condition and convert to Map with their count

From Dev

using Java 8 How to filter by list and group by based on filter condition and convert to Map with their count

From Dev

How to multiple filter list using jquery/javascript

From Dev

How to filter this data using Dictionary/List<Document>?

From Dev

how to filter product list using custom attribute

From Dev

How to make dropdown list filter using jQuery

From Dev

How to using stream in java 8 filter two list object and set value to new List

From Dev

How to use java 8 streams to make a new list by using another's list objects values with filter?

From Dev

Filter List using Linq

From Dev

How to filter a list using lodash if the filter function is asynchronous

From Dev

How to filter a list using the dropdown selected index using angularjs?

From Java

How to filter map of map using java stream

From Dev

How to filter map of map using java stream

From Java

How to compare two ArrayList and get list1 with filter using java streams

From Dev

How to compare two ArrayList and get list1 with filter using java streams

From Dev

How to filter directory listing by using a property from the resultant list itself in Java?

From Dev

How to filter a list based on another list using Linq?

From Dev

How to filter list of lists using streams on the basis of a value in a list?

From Dev

how to filter list which is inside List of class using linq?

From Dev

How to filter a list of required elements in list using listviewer in swt jface

From Java

Comparing two Integer list using java8 filter

From Dev

Will Java 8 create a new List after using Stream "filter" and "collect"?

From Dev

Filter on nested list using Java 8 Stream API

From Dev

Filter and modify list object using java 8 streams

Related Related

  1. 1

    How to filter list using angularjs

  2. 2

    How to filter a List using Java 8 stream and startwith array of values

  3. 3

    How to filter Map by a List using Java 8 stream?

  4. 4

    How to convert List to JavaRDD

  5. 5

    Filter list of objects without using hashmap java

  6. 6

    using Java 8 How to filter by list and group by based on filter condition and convert to Map with their count

  7. 7

    using Java 8 How to filter by list and group by based on filter condition and convert to Map with their count

  8. 8

    How to multiple filter list using jquery/javascript

  9. 9

    How to filter this data using Dictionary/List<Document>?

  10. 10

    how to filter product list using custom attribute

  11. 11

    How to make dropdown list filter using jQuery

  12. 12

    How to using stream in java 8 filter two list object and set value to new List

  13. 13

    How to use java 8 streams to make a new list by using another's list objects values with filter?

  14. 14

    Filter List using Linq

  15. 15

    How to filter a list using lodash if the filter function is asynchronous

  16. 16

    How to filter a list using the dropdown selected index using angularjs?

  17. 17

    How to filter map of map using java stream

  18. 18

    How to filter map of map using java stream

  19. 19

    How to compare two ArrayList and get list1 with filter using java streams

  20. 20

    How to compare two ArrayList and get list1 with filter using java streams

  21. 21

    How to filter directory listing by using a property from the resultant list itself in Java?

  22. 22

    How to filter a list based on another list using Linq?

  23. 23

    How to filter list of lists using streams on the basis of a value in a list?

  24. 24

    how to filter list which is inside List of class using linq?

  25. 25

    How to filter a list of required elements in list using listviewer in swt jface

  26. 26

    Comparing two Integer list using java8 filter

  27. 27

    Will Java 8 create a new List after using Stream "filter" and "collect"?

  28. 28

    Filter on nested list using Java 8 Stream API

  29. 29

    Filter and modify list object using java 8 streams

HotTag

Archive