How to declare sets with value in Scala?

0 votes
Can anyone provide an example how to declare sets with value in Scala?
Jul 30, 2019 in Apache Spark by Dhiraj
52 views

1 answer to this question.

0 votes

Hey,

You can follow this code:

scala> var s=Set(1,4,4,3)

s: scala.collection.immutable.Set[Int] = Set(1, 4, 3)

scala> var s:Set[Int]=Set(1,4,4,3)

s: Set[Int] = Set(1, 4, 3)

answered Jul 30, 2019 by Gitika
• 31,430 points

Related Questions In Apache Spark

0 votes
1 answer

How to concatenate sets in Scala?

Hey, Yes, there are two ways of doing ...READ MORE

answered Jul 30, 2019 in Apache Spark by Gitika
• 31,430 points
80 views
0 votes
1 answer

How to work with multidimensional arrays in Scala?

Hi, Here is an example you can follow: scala> ...READ MORE

answered Jul 30, 2019 in Apache Spark by Gitika
• 31,430 points
140 views
0 votes
1 answer

How to find max value in pair RDD?

Use Array.maxBy method: val a = Array(("a",1), ("b",2), ...READ MORE

answered May 25, 2018 in Apache Spark by nitinrawat895
• 10,920 points
4,006 views
0 votes
11 answers

How to create new column with function in Spark Dataframe?

val coder: (Int => String) = v ...READ MORE

answered Apr 4, 2019 in Apache Spark by anonymous

edited Apr 5, 2019 by Omkar 52,142 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
• 10,920 points
5,326 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
• 10,920 points
782 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
32,540 views
0 votes
1 answer

How to print loop with condition in scala?

Hi, Yes, in scala there is a guard condition where ...READ MORE

answered Jul 5, 2019 in Apache Spark by Gitika
• 31,430 points
58 views
0 votes
1 answer

How to find values common to two sets in Scala

Hey, There are two ways to find the ...READ MORE

answered Jul 30, 2019 in Apache Spark by Gitika
• 31,430 points
58 views