What filter transformation in apache spark

0 votes
Can anyone explain how filter transformation works in apache spark?
Aug 2, 2019 in Apache Kafka by Badri
1,444 views

1 answer to this question.

0 votes

Hi,

Filter() transformation in Apache Spark takes function as input.

It returns an RDD that only has element that pass the condition mentioned in input function.

val rdd1 = sc.parallelize(List(10,20,40,60)) 

val rdd2 = rdd2.filter(x => x !=10) println(rdd2.collect())

Output will be:

10.

answered Aug 2, 2019 by Gitika
• 65,770 points

Related Questions In Apache Kafka

0 votes
1 answer

What is the optimum number of producers to create in Kafka?

In general, a single producer for all ...READ MORE

answered Jul 10, 2018 in Apache Kafka by nitinrawat895
• 11,380 points
8,449 views
+1 vote
1 answer
0 votes
1 answer

How can I create a topic in apache kafka?

Hi@akhtar, To create kafka topic you can use ...READ MORE

answered Feb 6, 2020 in Apache Kafka by MD
• 95,460 points
1,152 views
0 votes
2 answers

How can I create multiple consumers in apache kafka?

First of all, Consumer is not thread ...READ MORE

answered Jun 18, 2020 in Apache Kafka by PAWAN
• 380 points
3,578 views
0 votes
1 answer

What are the differences between Apache Kafka and RabbitMQ?

Hi@akhtar, Apache kafka and RabitMQ have their own ...READ MORE

answered Feb 6, 2020 in Apache Kafka by MD
• 95,460 points
1,022 views
+1 vote
3 answers

What is the need of zookeeper in kafka? Can I use kafka without zookeeper?

I just would like to complete the ...READ MORE

answered Dec 4, 2020 in Apache Kafka by Tamás
• 140 points
8,746 views
+1 vote
2 answers
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,028 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,535 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,830 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP