5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-11 22:41:50 +08:00
Commit Graph

150 Commits

Author SHA1 Message Date
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