Hi Kunal,

It seem the target directory already exists for you?

hdfs://
sandbox.hortonworks.com:8020/user/hdfs/Product_DailyRevenueDetails_HPOC already
exists

Can you try removing it and rerun Sqoop command to see if that helps?

Thanks,
Rahul.

On Tue, Feb 2, 2016 at 8:17 PM, Kunal Gaikwad <aryan.ku...@gmail.com> wrote:

> Hi,
>
> I am getting an error when importing a tablel from sql server to hadoop
> via sqoop
>
> *Command:*
>  sudo -u hdfs sqoop import --driver
>  com.microsoft.sqlserver.jdbc.SQLServerDriver --connect "jdbc:sqlserver://
> 10.2.40.45;database=RMMBITOOLDB_DailyRev;username=dev;password=dev@123"
> --table Product_DailyRevenueDetails_HPOC  --split-by ID --hive-import --
> --target-dir "/user/hdfs/K/1"  --schema dbo
>
> *Error*:
> Warning: /usr/hdp/2.3.2.0-2950/accumulo does not exist! Accumulo imports
> will fail.
> Please set $ACCUMULO_HOME to the root of your Accumulo installation.
> find: failed to restore initial working directory: Permission denied
> 16/02/02 12:29:19 INFO sqoop.Sqoop: Running Sqoop version:
> 1.4.6.2.3.2.0-2950
> 16/02/02 12:29:19 INFO tool.BaseSqoopTool: Using Hive-specific delimiters
> for output. You can override
> 16/02/02 12:29:19 INFO tool.BaseSqoopTool: delimiters with
> --fields-terminated-by, etc.
> 16/02/02 12:29:19 WARN sqoop.ConnFactory: Parameter --driver is set to an
> explicit driver however appropriate connection manager is not being set
> (via --connection-manager). Sqoop is going to fall back to
> org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly
> which connection manager should be used next time.
> 16/02/02 12:29:19 INFO manager.SqlManager: Using default fetchSize of 1000
> 16/02/02 12:29:19 INFO tool.CodeGenTool: Beginning code generation
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in
> [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
> [jar:file:/usr/hdp/2.3.2.0-2950/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
> explanation.
> SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
> 16/02/02 12:29:21 INFO manager.SqlManager: Executing SQL statement: SELECT
> t.* FROM Product_DailyRevenueDetails_HPOC AS t WHERE 1=0
> 16/02/02 12:29:21 INFO manager.SqlManager: Executing SQL statement: SELECT
> t.* FROM Product_DailyRevenueDetails_HPOC AS t WHERE 1=0
> 16/02/02 12:29:21 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is
> /usr/hdp/2.3.2.0-2950/hadoop-mapreduce
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/sql/PreparedStatement.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/sql/ResultSet.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/sql/SQLException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/io/DataInput.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/io/DataOutput.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/io/IOException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/nio/ByteBuffer.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/nio/CharBuffer.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/sql/Date.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/sql/Time.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/sql/Timestamp.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/Arrays.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/Iterator.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/List.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/Map.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/TreeMap.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Cloneable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Object.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Long.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/String.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Integer.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Boolean.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/math/BigDecimal.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/InterruptedException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/StringBuilder.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/CharSequence.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/CloneNotSupportedException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Error.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Exception.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Throwable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/RuntimeException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/AutoCloseable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Number.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/Date.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Byte.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Character.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Short.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Float.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Double.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/io/Serializable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Comparable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/AbstractStringBuilder.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/StringBuffer.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/nio/Buffer.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Appendable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/ListIterator.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/Collection.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Iterable.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/time/LocalDateTime.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/math/BigInteger.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Void.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/SortedMap.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/Comparator.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/util/AbstractMap.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/NumberFormatException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> warning:
> /usr/jdk64/jdk1.8.0_40/lib/ct.sym(META-INF/sym/rt.jar/java/lang/IllegalArgumentException.class):
> major version 52 is newer than 51, the highest major version supported by
> this compiler.
>   It is recommended that the compiler be upgraded.
> Note:
> /tmp/sqoop-hdfs/compile/3637923de8c6688f60c6c21e1eb8e568/Product_DailyRevenueDetails_HPOC.java
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> 56 warnings
> 16/02/02 12:29:25 INFO orm.CompilationManager: Writing jar file:
> /tmp/sqoop-hdfs/compile/3637923de8c6688f60c6c21e1eb8e568/Product_DailyRevenueDetails_HPOC.jar
> 16/02/02 12:29:25 INFO mapreduce.ImportJobBase: Beginning import of
> Product_DailyRevenueDetails_HPOC
> 16/02/02 12:29:26 INFO manager.SqlManager: Executing SQL statement: SELECT
> t.* FROM Product_DailyRevenueDetails_HPOC AS t WHERE 1=0
> 16/02/02 12:29:28 INFO impl.TimelineClientImpl: Timeline service address:
> http://sandbox.hortonworks.com:8188/ws/v1/timeline/
> 16/02/02 12:29:28 INFO client.RMProxy: Connecting to ResourceManager at
> sandbox.hortonworks.com/10.0.2.15:8050
> 16/02/02 12:29:29 ERROR tool.ImportTool: Encountered IOException running
> import job: org.apache.hadoop.mapred.FileAlreadyExistsException: Output
> directory hdfs://
> sandbox.hortonworks.com:8020/user/hdfs/Product_DailyRevenueDetails_HPOC
> already exists
>         at
> org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:146)
>         at
> org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:266)
>         at
> org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:139)
>         at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
>         at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:422)
>         at
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
>         at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
>         at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1308)
>         at
> org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:196)
>         at
> org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:169)
>         at
> org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:266)
>         at
> org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:673)
>         at
> org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:497)
>         at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
>         at org.apache.sqoop.Sqoop.run(Sqoop.java:148)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
>         at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184)
>         at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226)
>         at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235)
>         at org.apache.sqoop.Sqoop.main(Sqoop.java:244)
>
> I had raised this question on stackoverflow as well link for your
> reference is:
>
> https://stackoverflow.com/questions/35063822/error-while-importing-data-through-sqoop-because-of-no-primary-key-in-the-table
>
>
> Thanks and regards,
> Kunal Anil Gaikwad
> Sr. Software Engineer - Big Data
> +91 9029648475
>



-- 
Regards,
Rahul.

Reply via email to