5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-07 16:01:54 +08:00
Commit Graph

260 Commits

Author SHA1 Message Date
Andrew Bayer
44ffd1e75b SQOOP-207. Support import as Avro Data Files.
(Tom White via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150047 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:40 +00:00
Andrew Bayer
5eaafd3243 SQOOP-225. Checkstyle module for detecting trailing white spaces.
This patch adds a checkstyle module to detect trailing white
spaces. It also removed various current instances of trailing
white spaces in the code.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150046 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:39 +00:00
Andrew Bayer
fe9c0666b9 SQOOP-91. Empty "columns" clause leads to null pointer exception
From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150045 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:38 +00:00
Andrew Bayer
bccae3464a SQOOP-224. Table name issue with PostgreSQL.
Recently the PostgresqlManager was updated to escape all identifier
names. This change addresses a couple of places where the identifier
was either not being escaped, or was being lower-case converted as
per the previous logic.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150044 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:38 +00:00
Andrew Bayer
eac50d0e24 SQOOP-212. Hive import for existing table does not work.
This patch fixes a bug that prevents importing data into
an existing hive table with the 'hive-overwrite' argument set.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150043 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:38 +00:00
Andrew Bayer
cb911f34b4 SQOOP-67. NPE when column name list contains spaces
- e.g. sqoop -import --columns "col1, col2"

From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150042 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:37 +00:00
Andrew Bayer
c0ca0c100b SQOOP-219. Duplicate columns arguments results in code generation compilation error
From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150041 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:37 +00:00
Andrew Bayer
913034315b SQOOP-48: Import bug when splitting over unsigned bigint column
From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150040 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:37 +00:00
Andrew Bayer
b84aaf3ab0 SQOOP-215. Support for codec aliases.
(Tom White via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150039 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:37 +00:00
Andrew Bayer
0870f9499a SQOOP-158. Additional methods for generated classes.
Adding setter-methods and a field-based equals-implementation to
the generated classes. These new methods enhance the usage of the
generated classes.

(Michael Häusler via ahmed)

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150037 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:36 +00:00
Andrew Bayer
dfd9021662 SQOOP-201. Support for arbitrary compression codec.
(Tom White via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150036 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:36 +00:00
Andrew Bayer
7fa8b68fab SQOOP-206. HBase import to use plugin InputFormat.
(Peter Hall via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150035 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:35 +00:00
Andrew Bayer
6acded9bb9 SQOOP-204. Allow connector specific bounds query.
This change introduces a new method in ConnManager that allows the
various implementations to optionally override it and specify
custom bounds query used for calculating splits during free form
query based imports.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150033 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:35 +00:00
Andrew Bayer
f9f45cf55d SQOOP-205. Add getJob() to JobBase
(Garrett Wu via Aaron Kimball)

From: Aaron Kimball <akimball83@gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150032 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:34 +00:00
Andrew Bayer
0efc5a4d55 SQOOP-100. Sqoop to support populating Hive table partitions.
Initial patch by Frank Maritato.

From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150031 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:34 +00:00
Andrew Bayer
34b7c72165 SQOOP-118. Sqoop should work without HBase where possible.
From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150029 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:33 +00:00
Andrew Bayer
f38e40e760 SQOOP-129. Newlines in RDBMS fields break Hive
From: Jonathan Hsieh <jon@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150028 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:33 +00:00
Andrew Bayer
79fd6b4d84 SQOOP-191. Supplying programmatic configuration.
(Aaron Kimball via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150027 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:33 +00:00
Andrew Bayer
aa41d0635e SQOOP-192. Limit HSQLDB export to single inserts.
(Aaron Kimball via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150026 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:32 +00:00
Andrew Bayer
7677d39b79 SQOOP-187. Allow skipping end-of-record delimiter.
The SqoopRecord.toString() and SqoopRecord.toString(DelimiterSet) methods
always append an end-of-record delimiter. Sqoop uses its own OutputFormat
when rendering these to text files, so that the user's delimiters are
preserved.

Other users could use this OutputFormat when working with SqoopRecord
instances in their own MapReduce code, but it would also be nice to "play
nice" with TextOutputFormat in the event that the intent is
newline-terminated records.

This patch allows users to suppress end-of-record delimiter generation when
formatting records with toString.

(Aaron Kimball via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150025 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:32 +00:00
Andrew Bayer
3bbb4a6314 SQOOP-170. Capturing causal exception for logging.
From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150024 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:32 +00:00
Andrew Bayer
67dce5cc36 SQOOP-185. Tool plugins should not reuse names.
(Aaron Kimball via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150023 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:31 +00:00
Andrew Bayer
a8dd09ddbe SQOOP-183. File rename fails for generated files.
(Angus He via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150022 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:31 +00:00
Andrew Bayer
cf117e6500 SQOOP-179. Adding setField() method to SqoopRecord
This change introduces a setField(fieldName, fieldVal) method for
SqoopRecord instances which would allow an arbitrary programmatic
"setter" function without requiring reflection.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150021 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:31 +00:00
Andrew Bayer
5ee493ee0c SQOOP-178. Support for tool plugins.
The change will look for ToolPlugin definitions in the
sqoop.tool.plugins configuration entry, or conf/tools.d. Each
ToolPlugin returns a list of ToolDesc entries, which are then
registered with SqoopTool.register() before the user's arguments
are parsed. The user can then run 'sqoop <custom-tool> args...'
as if it were part of the natural Sqoop system.

(Aaron Kimball via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150020 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:30 +00:00
Andrew Bayer
9db0f3b4a9 SQOOP-181. Improve formatting of help messages.
(Aaron Kimball via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150018 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:30 +00:00
Andrew Bayer
9219504fd8 SQOOP-166. Postgresql identifiers should be quoted
(James Grant via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150017 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:30 +00:00
Andrew Bayer
9b10f9b2c4 SQOOP-168. NPE due to null binary columns.
(Scott Foster via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150016 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:29 +00:00
Andrew Bayer
5774ddd6db SQOOP-165. Improved log message for unknown types.
(Lars Francke via Arvind Prabhakar)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150015 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:29 +00:00
Andrew Bayer
6f2e5c683a SQOOP-162. Changes for vendor-specific subclasses.
Minor changes to AsyncSqlExecThread to use execute instead of executeUpdate
and to DBRecordReader to allow subclasses to access the configuration object.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150014 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:29 +00:00
Andrew Bayer
d920b8a0e8 SQOOP-140. Control max. number of fetched records.
This change adds the ability of specifying the max. number of fetched records
from the database. This will solve problems that may arise when importing
large tables.

(Michael Häusler via ahmed)

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150011 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:28 +00:00
Andrew Bayer
3f8252a28c SQOOP-154. Fix connection leak in OracleManager.
From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150009 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:27 +00:00
Andrew Bayer
4e6351f372 SQOOP-148. Use catalog views for OracleManager.
This change updates the OracleManager to use catalog views for resolving
the necessary metadata.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150006 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:26 +00:00
Andrew Bayer
fbb283f54d SQOOP-143. Simplify test configuration.
This change removes the test that asserts the presence of a non-default hosts
file configuration. It also adds the necessary comments to the PostgresqlTest
to allow configuring the server for default hosts file configuration.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150003 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:25 +00:00
Andrew Bayer
1d5b7011a9 SQOOP-124. Improve error handling during export.
This change introduces the ability to use a staging table for intermediate
storage during execution for regular export jobs in insert mode. This allows
all of exported data to first be populated in the staging table and then
inserted into the destination table in a single transaction. Thus if a failure
were to occur during export, it is less likely to corrupt the destination
table data. Moreover, the staging table is emptied before the export
job starts populating it, which ensures that re-running the job does not
require any special clean up.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150002 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:25 +00:00
Andrew Bayer
23cebe14ba SQOOP-139. Doc update for SQOOP-125 changes.
This fix mainly corrects a minor option naming inconsistency in the
documentation.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150001 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:24 +00:00
Andrew Bayer
2de36d7aab SQOOP-141. BlobRef accessor returns incorrect data.
This change fixes the BlobRef implementation to return the appropriate stream
source or byte array from the BytesWritable instance by taking into
consideration the actual data length.

(Peter Hall via arvind)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150000 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:24 +00:00
Andrew Bayer
cc288b6784 SQOOP-126. Support for loading options from file.
This change allows Sqoop to load options from an options file. An
options file is specified using --options-file. All options that
are otherwise specified on the command line should be specified
in this file in the order they would otherwise appear on the command
line. Options files can contain empty lines and comments for
readability. More than one options file may be used for a single
tool invocation if so preferred. Leading and trailing spaces are
ignored unless they appear within single or double quotes. Quoted
options extending into multiple lines are not supported.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149999 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:24 +00:00
Andrew Bayer
2eaa878ff0 SQOOP-12. Alternate NULL formats.
This fix allows the user to optionally specify different null
representations. It addresses both the import and export use
cases, in addition to both string and non-string column types.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149996 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:23 +00:00
Andrew Bayer
b22904cbfe SQOOP-133. Removing shim layer mechanism.
This change removes the ShimLoader and various Shim classes such as CDH3Shim
etc. It introduces a couple of new classes - ConfigurationConstants and
ConfigurationHelper - that provide a unique place for articulating interface
related details such as configuration keys that can likely change from version
to version of Hadoop.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149994 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:22 +00:00
Andrew Bayer
df738df6c1 SQOOP-125. Allow user to specify database type.
This fix allows the user to optionally specify the connection
manager class to be used, instead of inferring it from the
connection string.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149993 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:21 +00:00
Andrew Bayer
b794959457 SQOOP-131. Hive import using free form query.
This change fixes a problem that prevented users from importing into Hive
data extracted using a free form query.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149992 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:21 +00:00
Andrew Bayer
5dd36c62da SQOOP-114. Fix for NPE.
This is a fix for a case of malformed command line arguments,
where the tool name is correct, the option is also correct,
but the value of the option is missing.

From: Ahmed Radwan <ahmed@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149990 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:20 +00:00
Andrew Bayer
e3638e8ce0 SQOOP-37. Escape table and column names for Hive.
Hive allows the use of keywords as column and table names as long as they are
escaped using back-ticks. This change makes Sqoop always escape table and
column names using back-ticks thereby allowing Sqoop to work with Hive tables
that use keywords for either the table name or column names.

(Lars Francke via arvind)

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149989 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:20 +00:00
Andrew Bayer
00821910b3 SQOOP-119. TextSplitter creates incorrect bounds.
The TextSplitter implementation used when creating splits on top
of String based columns, has a bug in its logic which causes
the bounds for splits to be created incorrectly. This results
in the import of duplicate data. This change fixes the TextSplitter
in order to ensure that the bound checks are created correctly.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149988 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:20 +00:00
Andrew Bayer
81608e42b6 SQOOP-110. Allow empty strings to represent NULL.
This change modifies the ClassWriter implementation to provide
support for interpeting empty strings as NULL values for datatypes
other than String. For String datatype, an explicit string 'null'
is interpreted as NULL value and empty string is not. This is
because certain databases distinguish between NULL and empty
strings.

The clone implementation generated by ClassWriter has also been
modified to make it more defensive against the presence of NULL
values.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149985 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:19 +00:00
Andrew Bayer
6da167490e SQOOP-99. CDH3Shim mapped to Hadoop 0.20.3.
Current CDH3 build includes version 0.20.3 of Hadoop which is now
mapped to CDH3Shim loader. Apart from that, this change includes
a change in build.xml and OracleUtils test class that allows the
ability to override connect string for Oracle tests.

From: Arvind Prabhakar <arvind@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149984 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:18 +00:00
Andrew Bayer
3509b7941e SQOOP-90. Tool to merge datasets imported via incremental import.
Adds 'merge' tool.
Adds MergeJob, Merge*Mapper, MergeReducer.
Merge-specific arguments added to SqoopOptions, BaseSqoopTool.
Add TestMerge to test that this tool functions as expected.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149980 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:17 +00:00
Andrew Bayer
c7b1ddb708 SQOOP-88. Parameterize pre-table-import validity checks in SqlManager.
Adds SqlManager.checkTableImportOptions() method called by importTable().

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149978 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:17 +00:00
Andrew Bayer
56e3553f40 SQOOP-81. Creation of /tmp/sqoop/compile is not multi-user friendly.
Create nonce dirs as /tmp/sqoop-${user.name}/compile.
Remove unused compilation directories at end of execution.
Do not memoize nonce compilation directory names in metastore.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149975 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:16 +00:00
Andrew Bayer
36f93eac1d SQOOP-77. Rename saved sessions to saved jobs.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149967 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:13 +00:00
Andrew Bayer
e825dc560c SQOOP-75. Allow configuration of ManagerFactories through a configuration subdirectory.
Files in conf/managers.d/ are treated as configuration files that specify
classes for sqoop.connection.factories. If this property is unset, these
files are processed in order.
ClassLoaderStack no longer attempts to load a jar if the test class is
already available with the current set of ClassLoaders.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149966 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:13 +00:00
Andrew Bayer
beb0b2e1c2 SQOOP-47. NPE if --append is specified with HBase import target.
AppendUtils checks for missing append source and exits gracefully.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149964 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:13 +00:00
Andrew Bayer
66c753c2e7 SQOOP-72. sqoop-eval should use PreparedStatement.execute().
Modify sqoop-eval to use generic execute() instead of
executeQuery()/executeUpdate().
The --update argument to sqoop-eval is unnecessary and has been removed.
Modify ResultSetPrinter to properly display left border on output.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149963 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:12 +00:00
Andrew Bayer
57141e1fc7 SQOOP-38. Direct PostgreSQL import only works when providing a port.
From: Lars Francke <lars.francke@gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149962 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:12 +00:00
Andrew Bayer
5c088f32ec SQOOP-73. Generated records should handle more boolean value formats.
Add BooleanParser to parse more strings than Boolean.valueOf() does.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149960 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:11 +00:00
Andrew Bayer
11124da4ba SQOOP-40. SqoopOptions should use annotations to bind fields to properties.
Added @StoredAsProperty annotation.
Modified SqoopOptions to use this for all scalar fields.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149959 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:11 +00:00
Andrew Bayer
7f53d52f4f SQOOP-69. Improve data accessible to ManagerFactory.accept().
Added ManagerFactory.accept(SessionData) API to allow ManagerFactory
to inspect the chosen SqoopTool.
Deprecated ManagerFactory.accept(SqoopOptions).

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149958 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:11 +00:00
Andrew Bayer
402a2cd61a SQOOP-68. Delimiters in strings are not escaped properly.
Use escape character to protect delimiters if enclosing character is
unavailable.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149957 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:10 +00:00
Andrew Bayer
16a4d0f002 SQOOP-66. Jar for ConnManager class is not included in job payload.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149956 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:10 +00:00
Andrew Bayer
ac43ae8d76 SQOOP-65. Refactor some utilities out of MySQLExportMapper.
getLocalWorkPath() moved into c.c.s.util.TaskId.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149955 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:10 +00:00
Andrew Bayer
1749a84f68 SQOOP-64. Refactor named FIFO creation into standalone utility.
Add com.cloudera.sqoop.io.NamedFifo class to represent named FIFO objects.
Added TestNamedFifo as unit test.
MySQLExportMapper now uses this utility.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149954 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:10 +00:00
Andrew Bayer
6a9eef446b SQOOP-63. JobBase classes unnecessarily create ConnManagers.
ImportJobContext and ExportJobContext now contain references to the
already-instantiated ConnManager. JobBase subclasses should no
longer use a ConnFactory, but should use the existing ConnManager.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149953 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:09 +00:00
Andrew Bayer
692ee04f14 SQOOP-59. 'sqoop eval' should support DDL/DML operations.
Added --update argument to sqoop-eval tool, which runs
the user's statement in update mode rather than select mode.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149952 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:09 +00:00
Andrew Bayer
7b6163851d SQOOP-54. Allow per-manager configuration of isolation level for metadata queries.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149948 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:08 +00:00
Andrew Bayer
777fef13e7 SQOOP-45. If compilation dir is unspecified, use a nonce directory.
.class and .jar generation occurs in a per-process anonymous
directory. Generation of .java files now occurs in the bin directory;
.java files are moved to the src directory after compilation.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149947 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:08 +00:00
Andrew Bayer
a7358e3585 SQOOP-6. Job completion percentage is inaccurate.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149945 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:07 +00:00
Andrew Bayer
6efcec0da2 SQOOP-41. Add support for incremental imports.
Modify ImportTool, SessionTool, to support incremental imports.
Add TestIncrementalImport to unit test incremental imports.
SqoopOptions now implements Cloneable.
SQOOP-44. Bugfix in ClassWriter: fix NPE if the case of column names specified
with --columns do not match the case reported by the database.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149944 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:07 +00:00
Andrew Bayer
41cee93c40 SQOOP-35. Bundle job dependencies via DistributedCache.
Sqoop, shim, JDBC driver, and $SQOOP_HOME/lib/*.jar are now all
placed in the DistributedCache for each job.
Removes generation of the 'lib/' subdir in generated jar files.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149943 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:06 +00:00
Andrew Bayer
09d4d46d34 SQOOP-46. Sqoop 'verbose' mode shows too much IPC chatter.
Adds a parent logger for the 'com.cloudera.sqoop' package.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149942 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:06 +00:00
Andrew Bayer
1a5f52f063 SQOOP-24. Copy o.a.h.mapreduce.lib.db classes into Sqoop.
Copy DataDrivenDBInputFormat, its dependencies, and tests into Sqoop
in the com.cloudera.sqoop.mapreduce.db package.
Reformatted code to match Sqoop style guide and eliminate findbugs warnings.
Changed existing Sqoop code to use this implementation rather than Hadoop's.
Modified TestDataDrivenDBInputFormat to use mem-only hsqldb to prevent
Hudson race condition.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149941 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:05 +00:00
Andrew Bayer
06b94587af SQOOP-39. (SIP-6) Session Management API.
Added SessionStorage API.
Added SessonData API.
Added SessionStorageFactory.
Added SessionTool for create/delete/execute/show/list operations on sessions.
SqoopOptions can read and write all "sticky" state to a Properties instance.
Added HsqldbSessionStorage to implement SessionStorage API.
Added AutoHsqldbStorage to auto-instantiate a local metastore for the user.
Added client metastore connection parameters to sqoop-site.xml.
Added metastore tool (MetastoreTool).
Added HsqldbMetaStore for standalone metastore instance.
Added metastore properties to sqoop-default.xml.
Added TestSessions unit tests of session API.
Renamed conf/sqoop-default.xml to conf/sqoop-site-template.xml.
Added conf/.gitignore for sqoop-site.xml.

Tests run:

Tested all metastore operations on an import session.
Tested that ~/.sqoop/-based storage will be auto-created by the metastore.
Tested that 'sqoop metastore'-based metastores can be connected to
by external clients.
Tested that 'sqoop metastore --shutdown' will gracefully shut down a running
metastore instance.
Tested that passwords are not stored in the metastore by default, and the
user is prompted for the password when executing that saved session.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149940 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:05 +00:00
Andrew Bayer
0f35d54f21 SQOOP-15. Do not assume that Job.getCounters() returns non-null.
If jobs are already retired, display a useful message on how to
enable the completed job store and suppress performance counter
usage, rather than crashing with a NullPointerException.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149939 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:05 +00:00
Andrew Bayer
0fcbcd759a SQOOP-10. Provide a useful error message when a Java compiler cannot be found.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149938 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:04 +00:00
Andrew Bayer
7e0ccb4008 SQOOP-14. Allow Sqoop to import data into HBase.
Added FieldMappable and FieldMapProcessor interfaces.
Added ProcessingException class.
Added NullOutputCommitter class.
SqoopRecord now has delegate() method which calls a FieldMapProcessor.
ClassWriter now generates getFieldMap() method for SqoopRecords.
Added HBasePutProcessor to transform SqoopRecords into Put commands,
implementing FieldMapProcessor.
Added PutTransformer interface class and ToStringPutTransformer implementation.
Added DelegatingOutputFormat that uses a FieldMapProcessor.
Added HBase deps to build.xml via hbase.home property.
Added HBase, ZooKeeper to the dependency net added by configure-sqoop.
Added HBaseImportJob, HBaseImportMapper.
ImportJobBase now has jobSetup() step executed just before job submission.
ImportJobContext now holds a reference to the ConnManager.
DataDrivenImportJob retrieves ConnManager from ImportJobContext, it no longer
creates a new one.
Added HBase table import configuration parameters to SqoopOptions, ImportTool.
SqlManager.importQuery() needs to set ConnManager in ImportJobContext.
Added HBase import user documentation.
Described PutTransformer API in developer docs.
Added HBase unit tests.
Added ANT_ARGUMENTS env variable to Hudson test scripts to allow freeform parameters.
Added HBASE_HOME and ZOOKEEPER_HOME variables to hudson scripts.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149935 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:03 +00:00
Andrew Bayer
6ea1665716 SQOOP-4. Add update-mode export process.
Add --update-key argument to sqoop-export tool.
Refactor ExportOutputFormat into AsyncSqlOutputFormat.
Added UpdateOutputFormat.
ClassWriter now allows alternate serialization order in database write() method.
SqoopOptions holds column list for alternate db serialization order.
Added TestExportUpdate unit test battery.
AsyncSqlRecordWriter now allows "batch" execution mode.
Updated documentation for export updates.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149933 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:02 +00:00
Andrew Bayer
b0cd632b58 SQOOP-3. Add ability to import arbitrary queries.
Add ConnManager.importQuery() API.
Change BaseSqoopTool.DEBUG_SQL_CMD_ARG to SQL_QUERY_ARG to reflect
the broader applicability of the argument.
Change 'debugSqlCmd' member of SqoopOptions to 'sqlQuery'.
CompilationManager now sets jar name based on specified class name.
Add tests for query support.
Add documentation for query-based import.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149932 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:02 +00:00
Andrew Bayer
d215cbac6e SQOOP-2. MySQLExportMapper does not send username.
If specified, pass --user argument to mysqlimport in MySQLExportMapper.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149930 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:01 +00:00
Andrew Bayer
c838d29b79 SequenceFile detection should ignore directories.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149928 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:00 +00:00
Andrew Bayer
572dc05009 OracleManager should limit getColNamesQuery() results.
http://github.com/cloudera/sqoop/issues#issue/6

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149927 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:00 +00:00
Andrew Bayer
f1faa0e375 Provide maven install/deploy tasks.
Maven pushes sqoop jar and shim jars.
Renamed shim jar files to conform to maven artifact-version naming.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149925 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:04:00 +00:00
Andrew Bayer
ca0dec83e7 Adjust regex used to recognize CDH3 in ShimLoader.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149920 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:58 +00:00
Andrew Bayer
b3023e2bf9 Hive import can use in-process Hive instance.
If the Hive CliDriver is present on the classpath, Sqoop will
call it directly in the same JVM, rather than invoke a separate
JVM instance for Hive.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149916 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:57 +00:00
Andrew Bayer
568a827a1c Append mode import and target-dir output
Signed-off-by: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149913 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:56 +00:00
Andrew Bayer
383e46201c Eliminate checkstyle warnings.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149909 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:55 +00:00
Andrew Bayer
3ab9ebd354 SIP-4. Refactor classes for public API 1.0.0.
Moves TaskId to com.cloudera.sqoop.util.
Add com.cloudera.sqoop.lib.DelimiterSet.
Rewrite FieldFormatter, RecordParser, to use DelimiterSet.
Add generated class version id to SqoopRecord.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149907 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:54 +00:00
Andrew Bayer
42875119dd Move org.apache.hadoop.sqoop to com.cloudera.sqoop
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149906 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:52 +00:00
Andrew Bayer
9f2d744a24 Add Hudson test scripts.
Add Hadoop 0.21 build support. -Dhadoop.dist now accepts 'apache21'.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149905 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:51 +00:00
Andrew Bayer
faabc51a90 Rewrite documentation for updated Sqoop API
Add documentation for all SqoopTool implementations.
Add database compatibility notes.
Separate user guide from the develpment guide.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149902 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:50 +00:00
Andrew Bayer
15f5375d76 Add "version" tool.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149901 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:49 +00:00
Andrew Bayer
20cd34e90c Fix additional checkstyle issues.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149900 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:49 +00:00
Andrew Bayer
0b96b5f1c3 Add checkstyle to build process.
Fix the overwhelming majority of existing violations.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149899 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:47 +00:00
Andrew Bayer
e926bf1fe0 New ExportOutputFormat with improved JDBC performance.
Added ExportOutputFormat.
JdbcExportJob uses ExportOutputFormat instead of DBOutputFormat.
SqoopRecord now supports write() to multi-row INSERT statement, clone().
ClassWriter generates methods to fulfill expanded SqoopRecord contract.
Added Jdbc MySQL tests to test multi-row statements.
BlobRef, ClobRef classes now support Cloneable interface.
Added ExportStressTest.
Added Oracle-specific ExportOutputFormat subclass.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149898 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:46 +00:00
Andrew Bayer
1eb4226230 SIP-3. File format for large object (LOB) storage.
Introduce LobFile format for storing large objects.
Implemented LobFile.Reader, LobFile.Writer classes.
Added a performance test of LobFile reading/writing speed.
Build system: fix cobertura build deps.
Remove unused utility classes from o.a.h.s.io.
Use LobFile for external storage in {B,C}lobRef.
Added LobReaderCache.
Converted BlobRef to read from LobFiles (through LobReaderCache).
LargeObjectLoader writes to LobFiles.
Common code from BlobRef and ClobRef factored out into LobRef abstract
base class.
Updated Test{B,C}lobRef and TestLargeObjectLoader for new external LOB storage.
Updated *ImportMappers to close LargeObjectLoaders when they're done.
Added performance tests to build.
Added script to run perf tests; factored out common logic into config script.
Fixed ivy dependency resolution to use multiple configuration inheritance.
Added LobFileStressTest.
Added readme with instructions to src/perftest directory.
Added CodecMap that abstracts compression codec classes to names.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149897 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:46 +00:00
Andrew Bayer
04fb6ee44f ShimLoader accepts 0.22.0-SNAPSHOT signature.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149896 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:46 +00:00
Andrew Bayer
b4d59da671 Fix dead store in SqoopOptions.setTmpDir().
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149895 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:46 +00:00
Andrew Bayer
b7a3f47222 SIP-1. Refactor operations into distinct tools.
Introduced SqoopTool interface.
Added cli package for option parsing:
includes RelatedOptions, ToolOptions, SqoopParser.
'Sqoop' is now a wrapper that invokes a SqoopTool.
Added setter methods for all fields of SqoopOptions.
Added commons-cli 1.2 build dependency.
Argument parsing is removed from SqoopOptions and pushed into individual tools.
Added HelpTool to display basic usage information for Sqoop and
usage for subcommands.
Added ImportTool to perform imports.
Added EvalSqlTool.
Added ExportTool.
Added ImportAllTablesTool.
Added ListDatabasesTool, ListTablesTool.
Added CodeGenTool.
Added CreateHiveTableTool.
Small changes to orm.ClassWriter.
Auto-generate bin scripts for all tools; include in release package.
Allow user to provide build properties in a file.
Shim use of GenericOptionsParser to allow cross-compilation.
Fix Hive testcases to pass under CDH.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149894 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:45 +00:00
Andrew Bayer
c37e2d0568 Set Oracle session timezone based on property.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149893 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:45 +00:00
Andrew Bayer
acba9c1aea Set default Oracle tz to GMT (safe default).
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149892 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:44 +00:00
Andrew Bayer
7be68f8418 Oracle connection pool caches closed connections
OracleConnManager now nullifies references to connection instances
after returning them to the connection cache or closing them.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149891 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:44 +00:00
Andrew Bayer
6ea36a07ad Support multiple MySQL export tasks per job/node
MySQLExportMapper now uses a task attempt-specific local directory to
store its FIFO objects.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149890 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:44 +00:00
Andrew Bayer
466c921b15 Export jobs should display progress.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149887 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:43 +00:00
Andrew Bayer
799f7e9070 Shims can be loaded from the classpath, or jars
CompilationManager now packs the active shim jar into the job jar.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149885 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:43 +00:00
Andrew Bayer
9a7dcdeafb MapReduce-API specific classes moved to shim jars.
All classes which depend on MapReduce APIs which change from
interfaces to classes between 0.20 and 0.22 are moved to distribution-
specific shim jars.
"Common" shim classes are now compiled multiple times against different
Hadoop distributions.
Shim classes are broken out into separate jars; ShimLoader now picks
the appropriate jar to load at runtime.
Configuration constants moved into HadoopShim.
BlobRef/ClobRef methods changed to use Mapper.Context for binary compatibility.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149884 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:42 +00:00
Andrew Bayer
db68b92108 Add 'ant javadoc' target.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149881 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:41 +00:00
Andrew Bayer
b55cb598da Add shim classes to allow compilation against different Hadoop distributions
Version-incompatible code now moved to HadoopShim subclasses.
HadoopShim singleton instance dynamically loaded based on VersionInfo.
Separate MRUnit builds from Apache and CDH placed in /lib subdirs.
Modified 'ant package' target to properly include all shims.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149880 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:41 +00:00
Andrew Bayer
0fde7dff8d Hive DDL generator uses INTEGER when it means INT.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149878 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:40 +00:00
Andrew Bayer
9374ed8398 Add support for mysqlimport-based export jobs.
Using --direct in conjunction with --export-dir on a MySQL database will use
mysqlimport to emit the data to the database.
DirectMySQLManager now creates instances of MySQLExportJob.
src/test/.../MySQLUtils is renamed to MySQLTestUtils to avoid conflict with
src/java/.../MySQLUtils added by this patch.
MySQLUtils contains methods factored out of import-specific code for sharing
with exports.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149877 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:40 +00:00
Andrew Bayer
abbfab1941 Refactor ExportJob to facilitate multiple kinds of export jobs.
Add 'JobBase' which attempts to unify ExportJob with ImportJobBase.
ImportJobBase and ExportJobBase override job-type specific behavior.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149875 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:40 +00:00
Andrew Bayer
8147d262d8 Enable findbugs on build and fix all warnings.
Some spurious warnings (and inconsequential warnings in test code)
have been disabled by src/test/findbugsExcludeFile.xml.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149874 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:39 +00:00
Andrew Bayer
7214230695 Support BINARY, VARBINARY, and RAW (Oracle) types
Added support for importing byte array columns as BytesWritable.
Tested with MySQL, Oracle, HSQLDB.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149873 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:39 +00:00
Andrew Bayer
2240be8807 Cache connections to Oracle across ConnManagers.
OracleManager now caches Connection instances for subsequent OracleManager
instances.
Refactored uses of ConnManager to call close() before discarding them.
This allows the Oracle JUnit tests to sleep less frequently to wait for Oracle
to reap closed server-side connection resources, improving Oracle test speed
by 50%.

Sleeping cannot be fully eliminated because MapReduce-side Connections are not
governed by this caching mechanism.

Also added some debugging advice re. this topic to OracleManagerTest's comment.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149872 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:39 +00:00
Andrew Bayer
6cbe7572e9 If --hive-import and --generate-only are specified, create a ddl script file.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149870 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:38 +00:00
Andrew Bayer
df76e995e8 Users can precisely control export parallelism.
Uses CombineFileInputFormat to run exports over a target number
of mappers independent of the number of input files.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149869 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:38 +00:00
Andrew Bayer
a0dd7e7490 Changed license headers to reference Cloudera instead of the ASF.
Adds NOTICE.txt file

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149868 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:36 +00:00
Andrew Bayer
b72a134b52 Show imported row count after job completion.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149867 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:36 +00:00
Andrew Bayer
bb29ce9492 Support for CLOB/BLOB data in external files.
CLOB/BLOB data may now be stored in additional files in HDFS which are
accessible through streams if the data cannot be fully materialized in RAM.
Adds tests for external large objects.
Refactored large object loading into the map() method from readFields().

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149866 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:35 +00:00
Andrew Bayer
32a67749b1 Run mysqldump in map task instead of on the client.
Major refactoring of DataDrivenImportJob to support mysqldump in mappers.
ImportJobBase added below DataDrivenImportJob.
MySQLDumpImportJob added on top of ImportJobBase.
LocalMySQLManager -> renamed to -> DirectMySQLManager now just runs MysqldumpIJ.
MySQLDumpImportJob configures MySQLDumpMapper to run mysqldump instances on
multiple nodes and is split-aware (via MySQLDumpInputFormat).
TestImportJob works with new ImportJobBase framework.
Added test that imports a subset of columns in mysql imports.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149865 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:35 +00:00
Andrew Bayer
14c9e0bf88 Use DataDrivenDBInputFormat with Oracle.
From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149863 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:34 +00:00
Andrew Bayer
7482c71cf9 Initial support for CLOB/BLOB types
Tests pass in Oracle and MySQL compatibility suites

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149862 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:34 +00:00
Andrew Bayer
c5c613cb92 MAPREDUCE-1444. Sqoop ConnManager instances can leak Statement objects. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149859 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:33 +00:00
Andrew Bayer
61d5da2500 MAPREDUCE-1467. Add a --verbose flag to Sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149858 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:33 +00:00
Andrew Bayer
6a215d0fbc MAPREDUCE-1469. Sqoop should disable speculative execution in export. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149857 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:33 +00:00
Andrew Bayer
a625fd478c MAPREDUCE-1341. Sqoop should have an option to create hive tables and skip the table import step. Contributed by Leonid Furman.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149856 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:32 +00:00
Andrew Bayer
de836d714a MAPREDUCE-1356. Allow user-specified hive table name in sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149855 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:32 +00:00
Andrew Bayer
69f04fff8b MAPREDUCE-1395. Sqoop does not check return value of Job.waitForCompletion(). Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149854 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:31 +00:00
Andrew Bayer
40da832916 MAPREDUCE-1394. Sqoop generates incorrect URIs in paths sent to Hive. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149853 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:31 +00:00
Andrew Bayer
e7a8e519f3 MAPREDUCE-1327. Fix Sqoop handling of Oracle timezone with timestamp data
types in import. Contributed by Leonid Furman

From: Christopher Douglas <cdouglas@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149852 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:31 +00:00
Andrew Bayer
6174268d28 MAPREDUCE-1313. Fix NPE in Sqoop when table with null fields uses escape
during import. Contributed by Aaron Kimball

From: Christopher Douglas <cdouglas@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149851 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:31 +00:00
Andrew Bayer
05929a73e5 MAPREDUCE-1310. CREATE TABLE statements for Hive do not correctly specify delimiters. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149849 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:30 +00:00
Andrew Bayer
b74084196f MAPREDUCE-1235. Fix a MySQL timestamp incompatibility in Sqoop. Contributed by Aaron Kimball
From: Christopher Douglas <cdouglas@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149848 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:30 +00:00
Andrew Bayer
681461461a MAPREDUCE-1174. Sqoop improperly handles table/column names which are reserved sql words. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149847 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:30 +00:00
Andrew Bayer
8b483c6ded MAPREDUCE-1146. Sqoop dependencies break Eclipse build on Linux. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149846 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:29 +00:00
Andrew Bayer
4686e0fee7 MAPREDUCE-1148. SQL identifiers are a superset of Java identifiers. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149845 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:29 +00:00
Andrew Bayer
12827a1765 MAPREDUCE-1224. Calling "SELECT t.* from <table> AS t" to get meta information is too expensive for big tables. Contributed by Spencer Ho.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149844 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:29 +00:00
Andrew Bayer
8e813b95a4 MAPREDUCE-1168. Export data to databases via Sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149843 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:28 +00:00
Andrew Bayer
ec8f687d97 MAPREDUCE-1169. Improvements to mysqldump use in Sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149840 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:28 +00:00
Andrew Bayer
9afc7a8aee MAPREDUCE-1069. Implement Sqoop API refactoring. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149837 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:27 +00:00
Andrew Bayer
93dab4998e MAPREDUCE-1017. Compression and output splitting for Sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149836 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:26 +00:00
Andrew Bayer
4a689cf491 MAPREDUCE-999. Improve Sqoop test speed and refactor tests. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149833 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:26 +00:00
Andrew Bayer
fd4f25baa4 MAPREDUCE-923. Sqoop classpath breaks for jar files with a plus sign in their names. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149831 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:25 +00:00
Andrew Bayer
7e3284691d MAPREDUCE-849. Rename configuration properties. Contributed by Amareshwari Sriramadasu.
From: Sharad Agarwal <sharad@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149830 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:25 +00:00
Andrew Bayer
8071445237 MAPREDUCE-777. Brand new apis to track and query jobs as a replacement for JobClient. Contributed by Amareshwari Sriramadasu.
From: Arun Murthy <acmurthy@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149829 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:25 +00:00
Andrew Bayer
37cadedc8f MAPREDUCE-907. Sqoop should use more intelligent splits. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149828 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:24 +00:00
Andrew Bayer
b34b2acc10 MAPREDUCE-938. Postgresql support for Sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149826 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:24 +00:00
Andrew Bayer
2bbf349f4c MAPREDUCE-918. Test hsqldb server should be memory-only. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149825 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:24 +00:00
Andrew Bayer
9e8955ede1 MAPREDUCE-876. Sqoop import of large tables can time out. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149824 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:23 +00:00
Andrew Bayer
89241b591a MAPREDUCE-750. Extensible ConnManager factory API. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149823 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:23 +00:00
Andrew Bayer
6cf87c5147 MAPREDUCE-789. Oracle support for Sqoop. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149820 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:23 +00:00
Andrew Bayer
ecbb765019 MAPREDUCE-816. Rename "local" mysql import to "direct" in Sqoop. (Aaron Kimball via matei).
From: Matei Alexandru Zaharia <matei@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149819 13f79535-47bb-0310-9956-ffa450edef68
2011-07-22 20:03:22 +00:00