- 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...
Now export this data from hdfs to mysql retail_db.departments table. During upload make sure existing department will just updated and no new departments needs to be inserted.
Now export this data from hdfs to mysql retail_db.departments table. During upload make sure existing department will just updated and no new departments needs to be inserted.View AnswerAnswer: Solution: Step 1: Create a csv tile named updateddepartments.csv with give content. Step 2: Now upload this tile to HDFS. Create a...
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...
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...
Now import the data from following directory into departments_export table, /user/cloudera/departments new
Now import the data from following directory into departments_export table, /user/cloudera/departments newView AnswerAnswer: Solution: Step 1: Login to musql db mysql --user=retail_dba -password=cloudera show databases; use retail_db; show tables; step 2: Create a table as given in problem statement. CREATE table departments_export (departmentjd int(11), department_name varchar(45), created_date T1MESTAMP DEFAULT NOW());...
Now export data from hive table departments_hive01 in departments_hive02. While exporting, please note following. wherever there is a empty string it should be loaded as a null value in mysql.
Now export data from hive table departments_hive01 in departments_hive02. While exporting, please note following. wherever there is a empty string it should be loaded as a null value in mysql. wherever there is -999 value for int field, it should be created as null value.View AnswerAnswer: Solution: Step 1: Create...
Store all the Java files in a directory called java_output to evalute the further
Store all the Java files in a directory called java_output to evalute the furtherView AnswerAnswer: Solution: Step 1: Drop all the tables, which we have created in previous problems. Before implementing the solution. Login to hive and execute following command. show tables; drop table categories; drop table customers; drop table...
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 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...