How to import scala packages

0 votes
How to import scala packages?
Nov 16, 2020 in Big Data Hadoop by anonymous
• 8,880 points
40 views

1 answer to this question.

0 votes

Scala packages can be imported so that they can be referenced in the current compilation scope. The following statement imports the contents of the scala.xml package −

import scala.xml._

You can import a single class and object, for example, HashMap from the scala.collection.mutable package −

import scala.collection.mutable.HashMap

You can import more than one class or object from a single package, for example, TreeMap and TreeSet from the scala.collection.immutable package −

import scala.collection.immutable.{TreeMap, TreeSet}
answered Nov 16, 2020 by Gitika
• 65,870 points

Related Questions In Big Data Hadoop

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
21,139 views
0 votes
1 answer

How to import data to HBase from SQL server?

You can easily import the data from ...READ MORE

answered Apr 20, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
767 views
0 votes
3 answers

Spark Scala: How to list all folders in directory

val spark = SparkSession.builder().appName("Demo").getOrCreate() val path = new ...READ MORE

answered Dec 4, 2018 in Big Data Hadoop by Mark
7,990 views
0 votes
1 answer

How to use sqoop import?

Here is an example of import command. ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 69,090 points
239 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,870 points
69 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,870 points
65 views
0 votes
1 answer

How to declare a variable in Scala?

The following is an example program that ...READ MORE

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

How to create an objects using a keyword new?

Example import java.io._ class Point(val xc: Int, val yc: ...READ MORE

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

How to import Flat files in Hadoop using sqoop?

Sqoop is a tool which we use ...READ MORE

answered Apr 9, 2019 in Big Data Hadoop by Gitika
• 65,870 points
703 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,870 points
38 views