How to create Scala Maps

0 votes
How to create Scala Maps
Nov 17, 2020 in Big Data Hadoop by Rajiv
• 8,880 points
61 views

1 answer to this question.

0 votes

Maps can be created in different ways based upon our requirement and nature of the Map. We have different syntax depending upon whether the Map is mutable or immutable.

Syntax :

// Immutable
variable = Map(key_1 -> value_1, key_2 -> value_2,
 key_3 -> value_3, ....)

// Mutable
variable = scala.collection.mutable.Map(key_1 -> value_1, 
key_2 -> value_2, key_3 -> value_3, ....)
answered Nov 17, 2020 by Gitika
• 65,930 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to create a FileSystem object that can be used for reading from and writing to HDFS?

Read operation on HDFS In order to read ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points

edited Mar 21, 2018 by nitinrawat895 1,478 views
0 votes
1 answer

How to groupBy/count then filter on count in Scala

I think the exception is caused because ...READ MORE

answered Apr 19, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
23,171 views
0 votes
1 answer

How to create a project for the first time in Hadoop.?

If you want to learn Hadoop framework ...READ MORE

answered Jul 26, 2018 in Big Data Hadoop by Neha
• 6,300 points
423 views
0 votes
1 answer

How to create smaller table from big table in HIVE?

You could probably best use Hive's built-in sampling ...READ MORE

answered Sep 24, 2018 in Big Data Hadoop by digger
• 26,720 points
857 views
0 votes
1 answer

How to start working with scala?

Scala can be installed on any UNIX ...READ MORE

answered Nov 16, 2020 in Big Data Hadoop by Gitika
• 65,930 points
75 views
0 votes
1 answer

How to execute scala programming?

We can execute a Scala program in ...READ MORE

answered Nov 16, 2020 in Big Data Hadoop by Gitika
• 65,930 points
118 views
0 votes
1 answer

How to write a Scala program in script mode?

Open notepad and add the following code ...READ MORE

answered Nov 16, 2020 in Big Data Hadoop by Gitika
• 65,930 points
148 views
0 votes
1 answer

How to import scala packages?

Scala packages can be imported so that ...READ MORE

answered Nov 16, 2020 in Big Data Hadoop by Gitika
• 65,930 points
79 views
0 votes
1 answer

How to create database in Mysql?

The command you can use is: create table ...READ MORE

answered Apr 15, 2019 in Big Data Hadoop by Gitika
• 65,930 points
235 views
0 votes
1 answer

How to create table inside database in MySql in Linux?

We can use this command to create ...READ MORE

answered Apr 15, 2019 in Big Data Hadoop by Gitika
• 65,930 points
211 views