Tables names as reserved keywords in Sqoop
<p>I have a table <code>int</code> in MySQL </p>

<pre><code>create table `int` (c1 varchar(20));

insert into `int` values ('some data');
</code></pre>

<p>I try to import it in hive using Sqoop:</p>

<p><code>sqoop import --connect='jdbc:mysql://xxx.xxx.xxx.xxx/classicmodels' --driver com.mysql.jdbc.Driver --username xxx --password xxx --table int --delete-target-dir --target-dir /tmp/test --hive-import --hive-table default.test --hive-drop-import-delims --null-string '\\N' --null-non-string '\\N' --split-by col_date -m 1 --verbose</code></p>

<p>Internally, it is creating  <code>SELECT t.* FROM int AS t WHERE 1=0</code></p>

<p>Error:</p>

<blockquote>
  <p>16/08/18 13:43:20 ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int AS t WHERE 1=0' at line 1</p>
</blockquote>

<p><em>which is expected.</em> </p>

<p>I tried,  <code>--table "int"</code>, <code>--table `int`</code> and  <code>--table "`int`"</code>. </p>

<p><strong>None of them worked.</strong></p>

<p>Is there any way to tell sqoop to create query: </p>

<p><code>SELECT t.* FROM `int` AS t WHERE 1=0</code></p>

<hr>

<p><code>[ ]</code> is used to bypass reserved words in SQL server.</p>

<p>In SQL Server <code>--table dbo.[int]</code> worked  for me.</p>