I have tried to import a table into HDFS using this command. At the end it said import job failed. I saw people mentioned to configure the mappred-site.xml. The configuration was done correctly and yet I still have this error. I found the file named "myTable" in HDFS but there was no data.
sqoop import --connect jdbc:mysql://localhost:3306/testDb --username Amel --password Amel@-1998 --table myTable;
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: Localized file:/usr/local/hadoop/sqoop/sqoop-1.4.7.jar as file:/app/hadoop/tmp/mapred/local/1625928112591/sqoop-1.4.7.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: Creating symlink: /app/hadoop/tmp/mapred/local/1625928112592/jackson-core-asl-1.9.13.jar <- /home/amel/jackson-core-asl-1.9.13.jar
21/07/10 16:41:54 WARN fs.FileUtil: Command 'ln -s /app/hadoop/tmp/mapred/local/1625928112592/jackson-core-asl-1.9.13.jar /home/amel/jackson-core-asl-1.9.13.jar' failed 1 with: ln: failed to create symbolic link '/home/amel/jackson-core-asl-1.9.13.jar': Permission denied
21/07/10 16:41:54 WARN mapred.LocalDistributedCacheManager: Failed to create symlink: /app/hadoop/tmp/mapred/local/1625928112592/jackson-core-asl-1.9.13.jar <- /home/amel/jackson-core-asl-1.9.13.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: Localized file:/usr/local/hadoop/sqoop/lib/jackson-core-asl-1.9.13.jar as file:/app/hadoop/tmp/mapred/local/1625928112592/jackson-core-asl-1.9.13.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112558/commons-lang3-3.4.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112559/mysql-connector-java-8.0.25.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112560/opencsv-2.3.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112561/slf4j-api-1.6.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112562/snappy-java-1.1.1.6.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112563/avro-mapred-1.8.1-hadoop2.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112564/xz-1.5.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112565/parquet-format-2.2.0-rc1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112566/kite-data-core-1.1.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112567/commons-io-1.4.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112568/ant-contrib-1.0b3.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112569/jackson-annotations-2.3.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112570/paranamer-2.7.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112571/commons-compress-1.8.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112572/kite-hadoop-compatibility-1.1.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112573/commons-codec-1.4.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112574/kite-data-mapreduce-1.1.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112575/ant-eclipse-1.0-jvm1.2.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112576/parquet-jackson-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112577/commons-logging-1.1.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112578/avro-1.8.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112579/parquet-encoding-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112580/parquet-hadoop-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112581/commons-jexl-2.1.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112582/jackson-core-2.3.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112583/kite-data-hive-1.1.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112584/parquet-common-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112585/parquet-avro-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112586/jackson-mapper-asl-1.9.13.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112587/parquet-column-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112588/parquet-generator-1.6.0.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112589/jackson-databind-2.3.1.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112590/hsqldb-1.8.0.10.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112591/sqoop-1.4.7.jar
21/07/10 16:41:54 INFO mapred.LocalDistributedCacheManager: file:/app/hadoop/tmp/mapred/local/1625928112592/jackson-core-asl-1.9.13.jar
21/07/10 16:41:54 INFO mapreduce.Job: The url to track the job: http://localhost:8080/
21/07/10 16:41:54 INFO mapreduce.Job: Running job: job_local1527603516_0001
21/07/10 16:41:54 INFO mapred.LocalJobRunner: OutputCommitter set in config null
21/07/10 16:41:54 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
21/07/10 16:41:54 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
21/07/10 16:41:54 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
21/07/10 16:41:54 INFO mapred.LocalJobRunner: Waiting for map tasks
21/07/10 16:41:54 INFO mapred.LocalJobRunner: Starting task: attempt_local1527603516_0001_m_000000_0
21/07/10 16:41:54 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
21/07/10 16:41:54 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
21/07/10 16:41:55 INFO mapred.Task: Using ResourceCalculatorProcessTree : [ ]
21/07/10 16:41:55 INFO db.DBInputFormat: Using read commited transaction isolation
21/07/10 16:41:55 INFO mapred.MapTask: Processing split: 1=1 AND 1=1
21/07/10 16:41:55 INFO mapred.LocalJobRunner: map task executor complete.
21/07/10 16:41:55 WARN mapred.LocalJobRunner: job_local1527603516_0001
java.lang.Exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class myTable not found
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:489)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:549)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class myTable not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2369)
at org.apache.sqoop.mapreduce.db.DBConfiguration.getInputClass(DBConfiguration.java:403)
at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.createDBRecordReader(DataDrivenDBInputFormat.java:270)
at org.apache.sqoop.mapreduce.db.DBInputFormat.createRecordReader(DBInputFormat.java:266)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:515)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:758)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Class myTable not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2273)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2367)
... 12 more
21/07/10 16:41:55 INFO mapreduce.Job: Job job_local1527603516_0001 running in uber mode : false
21/07/10 16:41:55 INFO mapreduce.Job: map 0% reduce 0%
21/07/10 16:41:55 INFO mapreduce.Job: Job job_local1527603516_0001 failed with state FAILED due to: NA
21/07/10 16:41:55 INFO mapreduce.Job: Counters: 0
21/07/10 16:41:55 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
21/07/10 16:41:55 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 4.3351 seconds (0 bytes/sec)
21/07/10 16:41:55 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
21/07/10 16:41:55 INFO mapreduce.ImportJobBase: Retrieved 0 records.
21/07/10 16:41:55 ERROR tool.ImportTool: Import failed: Import job failed!