- All Exams Instant Download
Import departments table as a text file in /user/cloudera/departments.
Import departments table as a text file in /user/cloudera/departments.View AnswerAnswer: 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...
Problem Scenario 23: You have been given log generating service as below.
Problem Scenario 23: You have been given log generating service as below. Start_logs (It will generate continuous logs) Tail_logs (You can check, what logs are being generated) Stop_logs (It will stop the log service) Path where logs are generated using above service: /opt/gen_logs/logs/access.log Now write a flume configuration file named...
Now import data from mysql table departments to this hive table. Please make sure that data should be visible using below hive command, select" from departments_hive
Now import data from mysql table departments to this hive table. Please make sure that data should be visible using below hive command, select" from departments_hiveView AnswerAnswer: Solution: Step 1: Create hive table as said. hive show tables; create table departments_hive(department_id int, department_name string); Step 2: The important here is,...
Please import the departments table in a directory called departments_enclosedby and file should be able to process by downstream system.
Please import the departments table in a directory called departments_enclosedby and file should be able to process by downstream system.View AnswerAnswer: Solution: Step 1: Connect to mysql database. mysql --user=retail_dba -password=cloudera show databases; use retail_db; show tables; Insert record Insert into departments values(9999, '"Data Science"'); select" from departments; Step 2:...
Problem Scenario 25: You have been given below comma separated employee information. That needs to be added in /home/cloudera/flumetest/in.txt file (to do tail source)
Problem Scenario 25: You have been given below comma separated employee information. That needs to be added in /home/cloudera/flumetest/in.txt file (to do tail source) sex, name, city 1, alok, mumbai 1, jatin, chennai 1, yogesh, kolkata 2, ragini, delhi 2, jyotsana, pune 1, valmiki, banglore Create a flume conf file...
While importing, make sure only male employee data is stored.
While importing, make sure only male employee data is stored.View AnswerAnswer: Step 1: Create hive table for flumeemployee.' CREATE TABLE flumemaleemployee ( name string, salary int, sex string, age int ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ', '; step 2: Create flume configuration file, with below configuration for source,...
Data should be written as text to hdfs
Data should be written as text to hdfsView AnswerAnswer: Solution: Step 1: Create directory mkdir /tmp/spooldir/bb mkdir /tmp/spooldir/dr Step 2: Create flume configuration file, with below configuration for agent1.sources = source1 source2 agent1 .sinks = sink1 agent1.channels = channel1 agent1 .sources.source1.channels = channel1 agentl .sources.source2.channels = channell agent1 .sinks.sinkl.channel =...
Data should be written as text to hdfs
Data should be written as text to hdfsView AnswerAnswer: Solution: Step 1: Create directory mkdir /tmp/spooldir/bb mkdir /tmp/spooldir/dr Step 2: Create flume configuration file, with below configuration for agent1.sources = source1 source2 agent1 .sinks = sink1 agent1.channels = channel1 agent1 .sources.source1.channels = channel1 agentl .sources.source2.channels = channell agent1 .sinks.sinkl.channel =...
Problem Scenario 4: You have been given MySQL DB with following details.
Problem Scenario 4: You have been given MySQL DB with following details. user=retail_dba password=cloudera database=retail_db table=retail_db.categories jdbc URL = jdbc:mysql://quickstart:3306/retail_db Please accomplish following activities. Import Single table categories (Subset data} to hive managed table, where category_id between 1 and 22View AnswerAnswer: Solution: Step 1: Import Single table (Subset data) sqoop...
Problem Scenario 25: You have been given below comma separated employee information. That needs to be added in /home/cloudera/flumetest/in.txt file (to do tail source)
Problem Scenario 25: You have been given below comma separated employee information. That needs to be added in /home/cloudera/flumetest/in.txt file (to do tail source) sex, name, city 1, alok, mumbai 1, jatin, chennai 1, yogesh, kolkata 2, ragini, delhi 2, jyotsana, pune 1, valmiki, banglore Create a flume conf file...