Free CCA175 Exam Braindumps (page: 10)

Page 10 of 25

Problem Scenario 88 : You have been given below three files
product.csv (Create this file in hdfs)
productID, productCode, name, quantity, price, supplierid
1001, PEN, Pen Red, 5000, 1.23, 501
1002, PEN, Pen Blue, 8000, 1.25, 501
1003, PEN, Pen Black, 2000, 1.25, 501
1004, PEC, Pencil 2B, 10000, 0.48, 502
1005, PEC, Pencil 2H, 8000, 0.49, 502
1006, PEC, Pencil HB, 0, 9999.99, 502
2001, PEC, Pencil 3B, 500, 0.52, 501
2002, PEC, Pencil 4B, 200, 0.62, 501
2003, PEC, Pencil 5B, 100, 0.73, 501
2004, PEC, Pencil 6B, 500, 0.47, 502
supplier.csv
supplierid, name, phone
501, ABC Traders, 88881111
502, XYZ Company, 88882222
503, QQ Corp, 88883333
products_suppliers.csv
productID, supplierID
2001, 501
2002, 501
2003, 501
2004, 502
2001, 503
Now accomplish all the queries given in solution.

1. It is possible that, same product can be supplied by multiple supplier. Now find each
product, its price according to each supplier.
2. Find all the supllier name, who are supplying 'Pencil 3B'
3. Find all the products , which are supplied by ABC Traders.

  1. See the explanation for Step by Step Solution and configuration.

Answer(s): A

Explanation:

Solution :
Step 1: It is possible that, same product can be supplied by multiple supplier. Now find
each product, its price according to each supplier.
val results = sqlContext.sql(......SELECT products.name AS Product Name', price, suppliers.name AS Supplier Name'
FROM products_suppliers
JOIN products ON products_suppliers.productlD = products.productID JOIN suppliers ON products_suppliers.supplierlD = suppliers.supplierlD null t
results.show()
Step 2: Find all the supllier name, who are supplying 'Pencil 3B' val results = sqlContext.sql(......SELECT p.name AS 'Product Name", s.name AS "Supplier Name'
FROM products_suppliers AS ps
JOIN products AS p ON ps.productID = p.productID
JOIN suppliers AS s ON ps.supplierlD = s.supplierlD
WHERE p.name = 'Pencil 3B"", M )
results.show()
Step 3: Find all the products , which are supplied by ABC Traders. val results = sqlContext.sql(......SELECT p.name AS 'Product Name", s.name AS "Supplier Name'
FROM products AS p, products_suppliers AS ps, suppliers AS s WHERE p.productID = ps.productID AND ps.supplierlD = s.supplierlD
AND s.name = 'ABC Traders".....)
results. show()



Problem Scenario 26 : You need to implement near real time solutions for collecting information when submitted in file with below information. You have been given below directory location (if not available than create it) /tmp/nrtcontent. Assume your departments upstream service is continuously committing data in this directory as a new file (not stream of data, because it is near real time solution). As soon as file committed in this directory that needs to be available in hdfs in /tmp/flume location
Data
echo "I am preparing for CCA175 from ABCTECH.com" > /tmp/nrtcontent/.he1.txt
mv /tmp/nrtcontent/.he1.txt /tmp/nrtcontent/he1.txt
After few mins
echo "I am preparing for CCA175 from TopTech.com" > /tmp/nrtcontent/.qt1.txt
mv /tmp/nrtcontent/.qt1.txt /tmp/nrtcontent/qt1.txt
Write a flume configuration file named flumes.conf and use it to load data in hdfs with following additional properties.

1. Spool /tmp/nrtcontent
2. File prefix in hdfs sholuld be events
3. File suffix should be Jog
4. If file is not commited and in use than it should have as prefix.
5. Data should be written as text to hdfs

  1. See the explanation for Step by Step Solution and configuration.

Answer(s): A

Explanation:

Solution :
Step 1: Create directory mkdir /tmp/nrtcontent
Step 2: Create flume configuration file, with below configuration for source, sink and channel and save it in flume6.conf.
agent1 .sources = source1
agent1 .sinks = sink1
agent1.channels = channel1
agent1 .sources.source1.channels = channel1
agent1 .sinks.sink1.channel = channel1
agent1 .sources.source1.type = spooldir
agent1 .sources.source1.spoolDir = /tmp/nrtcontent
agent1 .sinks.sink1 .type = hdfs
agent1 .sinks.sink1.hdfs.path = /tmp/flume
agent1.sinks.sink1.hdfs.filePrefix = events
agent1.sinks.sink1.hdfs.fileSuffix = .log
agent1 .sinks.sink1.hdfs.inUsePrefix = _
agent1 .sinks.sink1.hdfs.fileType = Data Stream
Step 4: Run below command which will use this configuration file and append data in hdfs.
Start flume service:
flume-ng agent -conf /home/cloudera/flumeconf -conf-file /home/cloudera/fIumeconf/fIume6.conf --name agent1
Step 5: Open another terminal and create a file in /tmp/nrtcontent echo "I am preparing for CCA175 from ABCTechm.com" > /tmp/nrtcontent/.he1.txt mv /tmp/nrtcontent/.he1.txt /tmp/nrtcontent/he1.txt
After few mins
echo "I am preparing for CCA175 from TopTech.com" > /tmp/nrtcontent/.qt1.txt mv /tmp/nrtcontent/.qt1.txt /tmp/nrtcontent/qt1.txt



Problem Scenario 56 : You have been given below code snippet.
val a = sc.parallelize(l to 100. 3)
operation1
Write a correct code snippet for operationl which will produce desired output, shown below.
Array [Array [I nt]] = Array(Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33),
Array(34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66),
Array(67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100))

  1. See the explanation for Step by Step Solution and configuration.

Answer(s): A

Explanation:

Solution :
a.glom.collect
glom
Assembles an array that contains all elements of the partition and embeds it in an RDD. Each returned array contains the contents of one panition



Problem Scenario 5 : You have been given following mysql database details.
user=retail_dba
password=cloudera
database=retail_db
jdbc URL = jdbc:mysql://quickstart:3306/retail_db
Please accomplish following activities.

1. List all the tables using sqoop command from retail_db
2. Write simple sqoop eval command to check whether you have permission to read
database tables or not.
3. Import all the tables as avro files in /user/hive/warehouse/retail cca174.db
4. Import departments table as a text file in /user/cloudera/departments.

  1. See the explanation for Step by Step Solution and configuration.

Answer(s): A

Explanation:

Solution:
Step 1: List tables using sqoop
sqoop list-tables --connect jdbc:mysql://quickstart:330G/retail_db --username retail dba - password cloudera
Step 2: Eval command, just run a count query on one of the table.

sqoop eval \
--connect jdbc:mysql://quickstart:3306/retail_db \
-username retail_dba \
-password cloudera \
--query "select count(1) from ordeMtems"
Step 3: Import all the tables as avro file.
sqoop import-all-tables \
-connect jdbc:mysql://quickstart:3306/retail_db \
-username=retail_dba \
-password=cloudera \
-as-avrodatafile \
-warehouse-dir=/user/hive/warehouse/retail stage.db \ -ml
Step 4: Import departments table as a text file in /user/cloudera/departments sqoop import \
-connect jdbc:mysql://quickstart:3306/retail_db \
-username=retail_dba \
-password=cloudera \
-table departments \
-as-textfile \
-target-dir=/user/cloudera/departments
Step 5: Verify the imported data.
hdfs dfs -Is /user/cloudera/departments
hdfs dfs -Is /user/hive/warehouse/retailstage.db
hdfs dfs -Is /user/hive/warehouse/retail_stage.db/products



Page 10 of 25



Post your Comments and Discuss Cloudera CCA175 exam with other Community members:

Pss wd commented on December 11, 2024
preparing for exam
Anonymous
upvote

Anonymous commented on December 11, 2024
really good
INDIA
upvote

Anonymous commented on December 10, 2024
Good questions for revision
UNITED STATES
upvote

Milik commented on December 10, 2024
Very resourceful information
Anonymous
upvote

Milik commented on December 10, 2024
Great info Marion to succeed on your test……….
Anonymous
upvote

Ritesh commented on December 10, 2024
Good content
Anonymous
upvote

Mikil commented on December 10, 2024
I will tell others about this study site
Anonymous
upvote

Milik commented on December 10, 2024
Good resource for your studies. I will refer to my frirnds
Anonymous
upvote

Mikil commented on December 10, 2024
I will tell others about this site.
Anonymous
upvote

Mikil commented on December 10, 2024
I will tell others of this site
Anonymous
upvote

Mikil commented on December 10, 2024
Great research for my test
Anonymous
upvote

Mikil commented on December 10, 2024
Great resource. I would tell others
Anonymous
upvote

Mikil commented on December 10, 2024
Great resource
Anonymous
upvote

Michelle commented on December 10, 2024
Great resource
Anonymous
upvote

ArulMani commented on December 10, 2024
It's very useful study for EMT exam
UNITED STATES
upvote

no name commented on December 10, 2024
helpful to recap the course
Anonymous
upvote

none commented on December 10, 2024
very helpful to recall the course
Anonymous
upvote

Sandeep Singh commented on December 10, 2024
All questions are from real exam.
UNITED STATES
upvote

Usman commented on December 10, 2024
It is a great collection but I have noticed that some answers are wrong. For example, it says that correct answer is B but the description of that answer matches with answer A. So it is advisable to read the answer's description as well.
Anonymous
upvote

Anamika commented on December 10, 2024
dumps are good and helpful
UNITED STATES
upvote

santosh k sharma commented on December 10, 2024
A good way to practice
Anonymous
upvote

Faith Egwuenu commented on December 09, 2024
The case studies/questions were very helpful.
Anonymous
upvote

Jaydin commented on December 09, 2024
Think I will do well on test I'm brave confident I swear no hard feelings
UNITED STATES
upvote

Jaydin grimball commented on December 09, 2024
I doing well thinks
UNITED STATES
upvote

Calista Eva commented on December 09, 2024
Good practice
UNITED STATES
upvote

mamatha commented on December 09, 2024
informative
Anonymous
upvote

Mishti commented on December 08, 2024
Preparing for certification
CANADA
upvote

Jbomb commented on December 08, 2024
I'll take the test and report back
KOREA REPUBLIC OF
upvote

Vic commented on December 08, 2024
Interesting answers
CANADA
upvote

Cristina commented on December 08, 2024
good questions
ROMANIA
upvote

kanhaiya kumar commented on December 08, 2024
awsome stuff
Anonymous
upvote

WILLIAM RIBEIRO RODRIGUES commented on December 08, 2024
Amazing place to learning and share knowleg.
BRAZIL
upvote

WILLIAM RIBEIRO RODRIGUES commented on December 08, 2024
Nice place to practice and learning.
BRAZIL
upvote

frans Bauwer commented on December 08, 2024
so far so good
BELGIUM
upvote