title: Sqoop - ERROR tool.ImportTool: Import failed: Cannot convert SQL type 2005 when trying to import from SQL Server
body: <p>I am trying to import a table from SQL server to Hive using Sqoop. Below is the command I am using:</p>
  
  <pre><code>sqoop import --connect "jdbc:jtds:sqlserver://xxxxxxxxxx:1433;integratedSecurity=false;databaseName=xxxx;domain=xxxx" --username user -P --table notifications --split-by Id --hive-import --create-hive-table --hive-table testing.notifications --as-parquetfile --verbose
  </code></pre>
  
  <p>The hive table does not exist and the idea is to create it using my sqoop command. However, when I run my command, I get the following error:</p>
  
  <pre><code>18/09/05 08:40:21 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM [notifications] AS t WHERE 1=0
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column Id of type [-5, 19, 0]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column Dt of type [93, 23, 3]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column path of type [12, 300, 0]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column type of type [12, 1000, 0]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column message of type [2005, 2147483647, 0]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column person of type [12, 100, 0]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column stage of type [12, 100, 0]
  18/09/05 08:40:21 DEBUG manager.SqlManager: Found column lastModified of type [93, 23, 3]
  18/09/05 08:40:21 DEBUG util.ClassLoaderStack: Restoring classloader: sun.misc.Launcher$AppClassLoader@64c64813
  18/09/05 08:40:21 ERROR tool.ImportTool: Import failed: Cannot convert SQL type 2005
  </code></pre>
  
  <p>However, when I remove the <code>--as-parquetfile</code> argument from my command, it works fine. What's the issue with using <code>--as-parquetfile</code> ?  </p>
  
  <p>I would need the table to be in parquet and I tried using a <code>--query</code> argument to convert <code>Dt</code> and <code>lastModified</code> columns which are in <code>timestamp</code> (I guess timestamp is what <code>[93, 23, 3]</code> represents ) format to strings like this:</p>
  
  <pre><code>--query "select Id, convert(varchar(25),Dt,120) as Dt, path, type, message, person, stage, convert(varchar(25),lastModified,120) as lastModified from dbo.notifications"
  </code></pre>
  
  <p>and the logs confirm that the datatypes for <code>Dt</code> and <code>lastModified</code> have been modified:</p>
  
  <pre><code>18/09/05 09:30:12 INFO manager.SqlManager: Executing SQL statement: select Id, convert(varchar(25),Dt,120) as Dt, path, type, message, person, stage, convert(varchar(25),lastModified,120) as lastModified from dbo.notifications WHERE  (1 = 0)
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column Id of type [-5, 19, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column Dt of type [12, 25, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column path of type [12, 300, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column type of type [12, 1000, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column message of type [2005, 2147483647, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column person of type [12, 100, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column stage of type [12, 100, 0]
  18/09/05 09:30:12 DEBUG manager.SqlManager: Found column lastModified of type [12, 25, 0]
  </code></pre>
  
  <p>But it still fails with the same error.</p>
  
  <p>I am not sure which column is causing the error. and I am also not sure if I can use <code>--map-column-hive</code> works with <code>--as-parquetfile</code>.</p>
  
  <p>any help would be appreciated. Thank you!</p>