apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chai...@apache.org
Subject apex-malhar git commit: APEXMALHAR-2372 changing the order of checks of table name in populateColumnDataTypes
Date Thu, 22 Dec 2016 06:36:06 GMT
Repository: apex-malhar
Updated Branches:
  refs/heads/master 113978fd3 -> 1816f78fa


APEXMALHAR-2372 changing the order of checks of table name in populateColumnDataTypes


Project: http://git-wip-us.apache.org/repos/asf/apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/apex-malhar/commit/1816f78f
Tree: http://git-wip-us.apache.org/repos/asf/apex-malhar/tree/1816f78f
Diff: http://git-wip-us.apache.org/repos/asf/apex-malhar/diff/1816f78f

Branch: refs/heads/master
Commit: 1816f78fafa8d0617ea1cac9de6637c85f388056
Parents: 113978f
Author: Hitesh-Scorpio <forhiteshjob@gmail.com>
Authored: Tue Dec 20 16:02:29 2016 +0530
Committer: Hitesh-Scorpio <forhiteshjob@gmail.com>
Committed: Tue Dec 20 16:34:12 2016 +0530

----------------------------------------------------------------------
 .../lib/db/jdbc/AbstractJdbcPOJOOutputOperator.java           | 2 +-
 .../datatorrent/lib/db/jdbc/JdbcPOJOInsertOutputOperator.java | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/1816f78f/library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPOJOOutputOperator.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPOJOOutputOperator.java
b/library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPOJOOutputOperator.java
index 99b14da..b4be480 100644
--- a/library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPOJOOutputOperator.java
+++ b/library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPOJOOutputOperator.java
@@ -209,7 +209,7 @@ public abstract class AbstractJdbcPOJOOutputOperator extends AbstractJdbcTransac
 
   /**
    * Set the target table name in database
-   * @param tablename
+   * @param tablename : table name as it is stored in the database
    */
   public void setTablename(String tablename)
   {

http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/1816f78f/library/src/main/java/com/datatorrent/lib/db/jdbc/JdbcPOJOInsertOutputOperator.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/com/datatorrent/lib/db/jdbc/JdbcPOJOInsertOutputOperator.java
b/library/src/main/java/com/datatorrent/lib/db/jdbc/JdbcPOJOInsertOutputOperator.java
index 8fe20fe..68daa8f 100644
--- a/library/src/main/java/com/datatorrent/lib/db/jdbc/JdbcPOJOInsertOutputOperator.java
+++ b/library/src/main/java/com/datatorrent/lib/db/jdbc/JdbcPOJOInsertOutputOperator.java
@@ -163,13 +163,12 @@ public class JdbcPOJOInsertOutputOperator extends AbstractJdbcPOJOOutputOperator
   {
     ResultSet rsColumns;
     DatabaseMetaData meta = store.getConnection().getMetaData();
+    rsColumns = meta.getColumns(null, null, getTablename(), null);
     /**Identifiers (table names, column names etc.) may be stored internally in either uppercase
or lowercase.**/
-    rsColumns = meta.getColumns(null, null, getTablename().toUpperCase(), null);
     if (!rsColumns.isBeforeFirst()) {
-      rsColumns = meta.getColumns(null, null, getTablename().toLowerCase(), null);
+      rsColumns = meta.getColumns(null, null, getTablename().toUpperCase(), null);
       if (!rsColumns.isBeforeFirst()) {
-        /** If the table name is in quotes then some Databases store it without doing any
uppercase or lowercase conversions */
-        rsColumns = meta.getColumns(null, null, getTablename(), null);
+        rsColumns = meta.getColumns(null, null, getTablename().toLowerCase(), null);
         if (!rsColumns.isBeforeFirst()) {
           throw new RuntimeException("Table name not found");
         }


Mime
View raw message