[
https://issues.apache.org/jira/browse/SQOOP-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mohamed El-Sayyad updated SQOOP-3144:
-------------------------------------
Description:
Requirement: Importing MySQL Database to HDFS
Minor Issue: No Unique Primary Key included in DB
Workaround: Added Year as partition Column
Current Issue:
org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0016:Can't fetch
schema
Cause:
This is because a double quote is appended, which is not parsed by MySQL DB.
Using min/max query: SELECT MIN("year"), MAX("year") FROM "sports"."players"
## Running the Query on MYSQL ##
With Double Quotes:
mysql> SELECT MIN("year"), MAX("year") FROM "sports"."players";
ERROR 1064 (42000): 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
'"sports"."players"' at line 1
Without Double Quotes:
mysql> SELECT MIN(year), MAX(year) FROM sports.players;
+-----------+-----------+
| MIN(year) | MAX(year) |
+-----------+-----------+
| 1950 | 2009 |
+-----------+-----------+
1 row in set (0.01 sec)
mysql>
## MySQL Version ##
mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+-------------------------+
| Variable_name | Value |
+-------------------------+-------------------------+
| innodb_version | 5.7.17 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1,TLSv1.1 |
| version | 5.7.17-0ubuntu0.16.04.1 |
| version_comment | (Ubuntu) |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+-------------------------+
8 rows in set (0.00 sec)
## MySQL Driver Version ##
hduser@cai-hadoop01:/usr/local/sqoop/bin$ ls -l ../lib
total 968
-rwxrwxrwx 1 root root 990927 Feb 12 15:26 mysql-connector-java-5.1.40-bin.jar
hduser@cai-hadoop01:/usr/local/sqoop/bin$
## SQOOP ENV Vars ##
export SQOOP_HOME=/usr/local/sqoop
export SQOOP_CONF_DIR=$SQOOP_HOME/conf
export SQOOP_CLASSPATH=$SQOOP_CONF_DIR
export SQOOP_SERVER_EXTRA_LIB=/usr/local/sqoop/lib
export PATH=$SQOOP_HOME/bin:/bin:/sbin:$PATH
was:
Requirement: Importing MySQL Database to HDFS
Minor Issue: No Unique Primary Key included in DB
Workaround: Added Year as partition Column
Current Issue:
org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0016:Can't fetch
schema
Cause:
This is because a double quote is appended, which is not parsed by MySQL DB.
Using min/max query: SELECT MIN("year"), MAX("year") FROM "sports"."players"
## Running the Query on MYSQL ##
With Double Quotes:
mysql> SELECT MIN("year"), MAX("year") FROM "sports"."players";
ERROR 1064 (42000): 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
'"sports"."players"' at line 1
Without Double Quotes:
mysql> SELECT MIN(year), MAX(year) FROM sports.players;
+-----------+-----------+
| MIN(year) | MAX(year) |
+-----------+-----------+
| 1950 | 2009 |
+-----------+-----------+
1 row in set (0.01 sec)
mysql>
> Exception: org.apache.sqoop.common.SqoopException Message:
> GENERIC_JDBC_CONNECTOR_0016:Can't fetch schema -
> -----------------------------------------------------------------------------------------------------------
>
> Key: SQOOP-3144
> URL: https://issues.apache.org/jira/browse/SQOOP-3144
> Project: Sqoop
> Issue Type: Bug
> Components: sqoop2-jdbc-connector
> Affects Versions: 1.99.7
> Environment: hduser@cai-hadoop01:/usr/local/sqoop/bin$ cat
> /etc/*release*
> DISTRIB_ID=Ubuntu
> DISTRIB_RELEASE=16.04
> DISTRIB_CODENAME=xenial
> DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
> NAME="Ubuntu"
> VERSION="16.04.1 LTS (Xenial Xerus)"
> ID=ubuntu
> ID_LIKE=debian
> PRETTY_NAME="Ubuntu 16.04.1 LTS"
> VERSION_ID="16.04"
> HOME_URL="http://www.ubuntu.com/"
> SUPPORT_URL="http://help.ubuntu.com/"
> BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
> UBUNTU_CODENAME=xenial
> hduser@cai-hadoop01:/usr/local/sqoop/bin$
> -----------------------------------------------------------
> hduser@cai-hadoop01:/usr/local/sqoop/bin$ uname -a
> Linux cai-hadoop01 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC
> 2016 x86_64 x86_64 x86_64 GNU/Linux
> Reporter: Mohamed El-Sayyad
> Labels: beginner, easyfix, easytest, newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Requirement: Importing MySQL Database to HDFS
> Minor Issue: No Unique Primary Key included in DB
> Workaround: Added Year as partition Column
> Current Issue:
> org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0016:Can't
> fetch schema
> Cause:
> This is because a double quote is appended, which is not parsed by MySQL DB.
> Using min/max query: SELECT MIN("year"), MAX("year") FROM "sports"."players"
> ## Running the Query on MYSQL ##
> With Double Quotes:
> mysql> SELECT MIN("year"), MAX("year") FROM "sports"."players";
> ERROR 1064 (42000): 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 '"sports"."players"' at line 1
> Without Double Quotes:
> mysql> SELECT MIN(year), MAX(year) FROM sports.players;
> +-----------+-----------+
> | MIN(year) | MAX(year) |
> +-----------+-----------+
> | 1950 | 2009 |
> +-----------+-----------+
> 1 row in set (0.01 sec)
> mysql>
> ## MySQL Version ##
> mysql> SHOW VARIABLES LIKE "%version%";
> +-------------------------+-------------------------+
> | Variable_name | Value |
> +-------------------------+-------------------------+
> | innodb_version | 5.7.17 |
> | protocol_version | 10 |
> | slave_type_conversions | |
> | tls_version | TLSv1,TLSv1.1 |
> | version | 5.7.17-0ubuntu0.16.04.1 |
> | version_comment | (Ubuntu) |
> | version_compile_machine | x86_64 |
> | version_compile_os | Linux |
> +-------------------------+-------------------------+
> 8 rows in set (0.00 sec)
> ## MySQL Driver Version ##
> hduser@cai-hadoop01:/usr/local/sqoop/bin$ ls -l ../lib
> total 968
> -rwxrwxrwx 1 root root 990927 Feb 12 15:26 mysql-connector-java-5.1.40-bin.jar
> hduser@cai-hadoop01:/usr/local/sqoop/bin$
> ## SQOOP ENV Vars ##
> export SQOOP_HOME=/usr/local/sqoop
> export SQOOP_CONF_DIR=$SQOOP_HOME/conf
> export SQOOP_CLASSPATH=$SQOOP_CONF_DIR
> export SQOOP_SERVER_EXTRA_LIB=/usr/local/sqoop/lib
> export PATH=$SQOOP_HOME/bin:/bin:/sbin:$PATH
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)