Repository: sqoop Updated Branches: refs/heads/trunk 7bbaf9968 -> c109f6717
SQOOP-2296: Merge statement incorrectly includes table hints (Keegan Witt via Jarek Jarcec Cecho) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/c109f671 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/c109f671 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/c109f671 Branch: refs/heads/trunk Commit: c109f671700ea601e5f3d83f61a04b02dc8f4828 Parents: 7bbaf99 Author: Jarek Jarcec Cecho <[email protected]> Authored: Mon Apr 20 19:52:31 2015 -0700 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Mon Apr 20 19:52:31 2015 -0700 ---------------------------------------------------------------------- .../sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormat.java | 6 ------ .../mapreduce/sqlserver/SqlServerUpsertOutputFormatTest.java | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/c109f671/src/java/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormat.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormat.java b/src/java/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormat.java index 0cb2c78..5abb5ea 100644 --- a/src/java/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormat.java +++ b/src/java/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormat.java @@ -149,12 +149,6 @@ public class SqlServerUpsertOutputFormat<K extends SqoopRecord, V> } sb.append(" )"); - String tableHints = getConf().get(org.apache.sqoop.manager.SQLServerManager.TABLE_HINTS_PROP); - if (tableHints != null) { - LOG.info("Using table hints for query hints: " + tableHints); - sb.append(" OPTION (").append(tableHints).append(")"); - } - sb.append(";"); return sb.toString(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/c109f671/src/test/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormatTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormatTest.java b/src/test/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormatTest.java index a144e30..a89e800 100644 --- a/src/test/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormatTest.java +++ b/src/test/org/apache/sqoop/mapreduce/sqlserver/SqlServerUpsertOutputFormatTest.java @@ -52,7 +52,6 @@ public class SqlServerUpsertOutputFormatTest { StringUtils.join(columnNames, ',')); conf.set(ExportJobBase.SQOOP_EXPORT_UPDATE_COL_KEY, StringUtils.join(updateKeyColumns, ',')); - conf.set(SQLServerManager.TABLE_HINTS_PROP, "NOLOCK"); conf.set(SQLServerManager.IDENTITY_INSERT_PROP, "true"); TaskAttemptContext context = null; Class cls = null; @@ -90,7 +89,7 @@ public class SqlServerUpsertOutputFormatTest { + "_source.SecondColumn, _target.ThirdColumn = _source.ThirdColumn" + " WHEN NOT MATCHED THEN INSERT ( FirstColumn, SecondColumn," + " ThirdColumn ) VALUES " - + "( _source.FirstColumn, _source.SecondColumn, _source.ThirdColumn ) " - + "OPTION (NOLOCK);", recordWriter.getUpdateStatement()); + + "( _source.FirstColumn, _source.SecondColumn, _source.ThirdColumn );", + recordWriter.getUpdateStatement()); } }
