CertsTime has provided you with a sample question set to elevate your knowledge about the Cloudera CCA Spark and Hadoop Developer exam. With these updated sample questions, you can become quite familiar with the difficulty level and format of the real CCA175 certification test. Try our sample Cloudera CCA Spark and Hadoop Developer certification practice exam to get a feel for the real exam environment. Our sample practice exam gives you a sense of reality and an idea of the questions on the actual Cloudera Certified Associate certification exam.
Our sample questions are similar to the Real Cloudera CCA175 exam questions. The premium Cloudera CCA Spark and Hadoop Developer certification practice exam gives you a golden opportunity to evaluate and strengthen your preparation with real-time scenario-based questions. Plus, by practicing real-time scenario-based questions, you will run into a variety of challenges that will push you to enhance your knowledge and skills.
Problem Scenario 94 : You have to run your Spark application on yarn with each executor 20GB and number of executors should be 50.Please replace XXX, YYY, ZZZ
-deploy-mode cluster \ # can be client for client mode
A SolutionProblem Scenario 86 : In Continuation of previous question, please accomplish following activities.
1. Select Maximum, minimum, average , Standard Deviation, and total quantity.
2. Select minimum and maximum price for each product code.
3. Select Maximum, minimum, average , Standard Deviation, and total quantity for each product code, hwoever make sure Average and Standarddeviation will have maximum two decimal values.
4. Select all the product code and average price only where product count is more than or equal to 3.
5. Select maximum, minimum , average and total of all the products for each code. Also produce the same across all the products.
A Solution :
Step 1 : Select Maximum, minimum, average , Standard Deviation, and total quantity.
val results = sqlContext.sql('. SELECT MAX(price) AS MAX , MIN(price) AS MIN , AVG(price) AS Average, STD(price) AS STD, SUM(quantity) AStotal_products FROM products. )
results. showQ
Step 2 : Select minimum and maximum price for each product code.
val results = sqlContext.sql(. SELECT code, MAX(price) AS Highest Price', MIN(price) AS Lowest Price'
FROM products GROUP BY code. )
results. showQ
Step 3 : Select Maximum, minimum, average , Standard Deviation, and total quantity for each product code, hwoever make sure Average andStandard deviation will have maximum two decimal values.
val results = sqlContext.sql(. SELECT code, MAX(price), MIN(price),
CAST(AVG(price> AS DECIMAL(7,2)) AS Average', CAST(STD(price) AS DECIMAL(7,2)) AS 'Std Dev\ SUM(quantity) FROM products
GROUP BY code. )
results. showQ
Step 4 : Select all the product code and average price only where product count is more than or equal to 3.
val results = sqlContext.sql(. SELECT code AS Product Code',
COUNTf) AS Count',
CAST(AVG(price) AS DECIMAL(7,2)) AS Average' FROM products GROUP BY code
HAVING Count >=3'M') results. showQ
Step 5 : Select maximum, minimum , average and total of all the products for each code. Also produce the same across all the products.
val results = sqlContext.sql( '''SELECT
code,
MAX(price),
MIN(pnce),
CAST(AVG(price) AS DECIMAL(7,2)) AS Average',
SUM(quantity)-
FROM products
GROUP BY code
WITH ROLLUP''' )
results. show()
B Solution :
Step 1 : Select Maximum, minimum, average , Standard Deviation, and total quantity.
val results = sqlContext.sql('. SELECT MAX(price) AS MAX , MIN(price) AS MIN , AVG(price) AS Average, STD(price) AS STD, SUM(quantity) AStotal_products FROM products. )
results. showQ
Step 2 : Select minimum and maximum price for each product code.
val results = sqlContext.sql(. SELECT code, MAX(price) AS Highest Price', MIN(price) AS Lowest Price'
FROM products GROUP BY code. )
results. showQ
Step 3 : Select Maximum, minimum, average , Standard Deviation, and total quantity for each product code, hwoever make sure Average andStandard deviation will have maximum two decimal values.
val results = sqlContext.sql(. SELECT code, MAX(price), MIN(price),
GROUP BY code. )
results. showQ
Step 4 : Select all the product code and average price only where product count is more than or equal to 3.
val results = sqlContext.sql(. SELECT code AS Product Code',
COUNTf) AS Count',
CAST(AVG(price) AS DECIMAL(7,2)) AS Average' FROM products GROUP BY code
HAVING Count >=3'M') results. showQ
Step 5 : Select maximum, minimum , average and total of all the products for each code. Also produce the same across all the products.
val results = sqlContext.sql( '''SELECT
code,
MAX(price),
WITH ROLLUP''' )
results. show()
Problem Scenario 85 : In Continuation of previous question, please accomplish following activities.
1. Select all the columns from product table with output header as below. productID AS ID
code AS Code name AS Description price AS 'Unit Price'
2. Select code and name both separated by ' -' and header name should be Product Description'.
3. Select all distinct prices.
4. Select distinct price and name combination.
5. Select all price data sorted by both code and productID combination.
6. count number of products.
7. Count number of products for each code.
A Solution :
Step 1 : Select all the columns from product table with output header as below. productID AS ID code AS Code name AS Description price AS 'Unit Price'
val results = sqlContext.sql(. SELECT productID AS ID, code AS Code, name AS Description, price AS Unit Price' FROM products ORDER BY ID'''
results.show()
Step 2 : Select code and name both separated by ' -' and header name should be 'Product Description.
val results = sqlContext.sql(. SELECT CONCAT(code,' -', name) AS Product Description, price FROM products''' )
results.showQ
Step 3 : Select all distinct prices.
val results = sqlContext.sql(. SELECT DISTINCT price AS Distinct Price' FROM products. )
results.show()
Step 4 : Select distinct price and name combination.
val results = sqlContext.sql(. SELECT DISTINCT price, name FROM products''' )
results. showQ
Step 5 : Select all price data sorted by both code and productID combination.
val results = sqlContext.sql('. SELECT' FROM products ORDER BY code, productID'. )
results.show()
Step 6 : count number of products.
val results = sqlContext.sql(. SELECT COUNT(') AS 'Count' FROM products. )
results.show()
Step 7 : Count number of products for each code.
val results = sqlContext.sql(. SELECT code, COUNT('> FROM products GROUP BY code. )
results. showQ
val results = sqlContext.sql(. SELECT code, COUNT('> AS count FROM products GROUP BY code ORDER BY count DESC. )
results. showQ
B Solution :
Step 1 : Select all the columns from product table with output header as below. productID AS ID code AS Code name AS Description price AS 'Unit Price'
val results = sqlContext.sql(. SELECT productID AS ID, code AS Code, name AS Description, price AS Unit Price' FROM products ORDER BY ID'''
results.show()
Step 2 : Select code and name both separated by ' -' and header name should be 'Product Description.
val results = sqlContext.sql(. SELECT CONCAT(code,' -', name) AS Product Description, price FROM products''' )
results.showQ
Step 3 : Select all distinct prices.
val results = sqlContext.sql(. SELECT DISTINCT price AS Distinct Price' FROM products. )
results.show()
Step 4 : count number of products.
val results = sqlContext.sql(. SELECT COUNT(') AS 'Count' FROM products. )
results.show()
Step 5 : Count number of products for each code.
val results = sqlContext.sql(. SELECT code, COUNT('> FROM products GROUP BY code. )
results. showQ
val results = sqlContext.sql(. SELECT code, COUNT('> AS count FROM products GROUP BY code ORDER BY count DESC. )
results. showQ
Problem Scenario 84 : In Continuation of previous question, please accomplish following activities.
1. Select all the products which has product code as null
2. Select all the products, whose name starts with Pen and results should be order by Price descending order.
3. Select all the products, whose name starts with Pen and results should be order by Price descending order and quantity ascending order.
4. Select top 2 products by price
A Solution :
Step 1 : Select all the products which has product code as null
val results = sqlContext.sql(. SELECT' FROM products WHERE code IS NULL. )
results. showQ
val results = sqlContext.sql(. SELECT * FROM products WHERE code = NULL ',,M )
results.showQ
Step 2 : Select all the products , whose name starts with Pen and results should be order by Price descending order. val results = sqlContext.sql(. SELECT * FROM products WHERE name LIKE 'Pen %' ORDER BY price DESC. )
results. showQ
Step 3 : Select all the products , whose name starts with Pen and results should be order by Price descending order and quantity ascending order. val results = sqlContext.sql('. SELECT * FROM products WHERE name LIKE 'Pen %' ORDER BY price DESC, quantity. )
results. showQ
Step 4 : Select top 2 products by price
val results = sqlContext.sql(. SELECT' FROM products ORDER BY price desc LIMIT2. >
results. show()
B Solution :
Step 1 : Select all the products which has product code as null
val results = sqlContext.sql(. SELECT' FROM products WHERE code IS NULL. )
results. showQ
val results = sqlContext.sql(. SELECT * FROM products WHERE code = NULL ',,M )
results.showQ
Step 2 : Select all the products , whose name starts with Pen and results should be order by Price descending order. val results = sqlContext.sql(. SELECT * FROM products WHERE name LIKE 'Pen %' ORDER BY price DESC. )
results. showQ
Step 3 : Select top 2 products by price
val results = sqlContext.sql(. SELECT' FROM products ORDER BY price desc LIMIT2. >
results. show()
Problem Scenario 83 : In Continuation of previous question, please accomplish following activities.
1. Select all the records with quantity >= 5000 and name starts with 'Pen'
2. Select all the records with quantity >= 5000, price is less than 1.24 and name starts with 'Pen'
3. Select all the records witch does not have quantity >= 5000 and name does not starts with 'Pen'
4. Select all the products which name is 'Pen Red', 'Pen Black'
5. Select all the products which has price BETWEEN 1.0 AND 2.0 AND quantity BETWEEN 1000 AND 2000.
A Solution :
Step 1 : Select all the records with quantity >= 5000 and name starts with 'Pen'
val results = sqlContext.sql(. SELECT * FROM products WHERE quantity >= 5000 AND name LIKE 'Pen %. )
results.show()
Step 2 : Select all the records with quantity >= 5000 , price is less than 1.24 and name starts with 'Pen'
val results = sqlContext.sql(. SELECT * FROM products WHERE quantity >= 5000 AND price < 1.24 AND name LIKE 'Pen %. )
results. showQ
Step 3 : Select all the records witch does not have quantity >= 5000 and name does not starts with 'Pen'
val results = sqlContext.sql('. SELECT * FROM products WHERE NOT (quantity >= 5000 AND name LIKE 'Pen %'). )
results. showQ
Step 4 : Select all the products which has price BETWEEN 1.0 AND 2.0 AND quantity BETWEEN 1000 AND 2000.
val results = sqlContext.sql(. SELECT * FROM products WHERE (price BETWEEN 1.0 AND 2.0) AND (quantity BETWEEN 1000 AND 2000). )
results. show()
B Solution :
Step 1 : Select all the records with quantity >= 5000 and name starts with 'Pen'
val results = sqlContext.sql(. SELECT * FROM products WHERE quantity >= 5000 AND name LIKE 'Pen %. )
results.show()
Step 2 : Select all the records with quantity >= 5000 , price is less than 1.24 and name starts with 'Pen'
val results = sqlContext.sql(. SELECT * FROM products WHERE quantity >= 5000 AND price < 1.24 AND name LIKE 'Pen %. )
results. showQ
Step 3 : Select all the records witch does not have quantity >= 5000 and name does not starts with 'Pen'
val results = sqlContext.sql('. SELECT * FROM products WHERE NOT (quantity >= 5000 AND name LIKE 'Pen %'). )
results. showQ
Step 4 : Select all the products wchich name is 'Pen Red', 'Pen Black'
val results = sqlContext.sql('. SELECT' FROM products WHERE name IN ('Pen Red', 'Pen Black'). )
results. showQ
Step 5 : Select all the products which has price BETWEEN 1.0 AND 2.0 AND quantity BETWEEN 1000 AND 2000.
val results = sqlContext.sql(. SELECT * FROM products WHERE (price BETWEEN 1.0 AND 2.0) AND (quantity BETWEEN 1000 AND 2000). )
results. show()