[ 
https://issues.apache.org/jira/browse/TAJO-233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14174506#comment-14174506
 ] 

Hyunsik Choi edited comment on TAJO-233 at 10/17/14 12:26 AM:
--------------------------------------------------------------

+1

The patch looks nice to me. Thank you for suggesting a nice solution. I also 
agree with your choice. 

I just changed PostgreSQLStore used in TestCatalog to take given username and 
password in jvm option. It's a trivial change. I'll commit it shortly.

{noformat:title=tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java}
-    // MySQLStore/MariaDB requires password
-    if (driverClass.equals(MySQLStore.class.getCanonicalName()) || 
driverClass.equals(MariaDBStore.class.getCanonicalName())) {
+    // MySQLStore/MariaDB/PostgreSQL requires username (and password).
+    if (isConnectionIdRequired(driverClass)) {
       if (connectionId == null) {
         throw new CatalogException(String.format("%s driver requires %s", 
driverClass, CatalogConstants.CONNECTION_ID));
       }
@@ -114,6 +115,12 @@ public class TestCatalog {
       catalog.dropTable(table);
     }
  }
+
+  public static boolean isConnectionIdRequired(String driverClass) {
+    return driverClass.equals(MySQLStore.class.getCanonicalName()) ||
+           driverClass.equals(MariaDBStore.class.getCanonicalName()) ||
+           driverClass.equals(PostgreSQLStore.class.getCanonicalName());
+  }
{noformat}


was (Author: hyunsik):
+1

The patch looks nice to me. I just changed PostgreSQLStore used in TestCatalog 
to take given username and password in jvm option. It's a trivial change. I'll 
commit it shortly.

{noformat:title=tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java}
-    // MySQLStore/MariaDB requires password
-    if (driverClass.equals(MySQLStore.class.getCanonicalName()) || 
driverClass.equals(MariaDBStore.class.getCanonicalName())) {
+    // MySQLStore/MariaDB/PostgreSQL requires username (and password).
+    if (isConnectionIdRequired(driverClass)) {
       if (connectionId == null) {
         throw new CatalogException(String.format("%s driver requires %s", 
driverClass, CatalogConstants.CONNECTION_ID));
       }
@@ -114,6 +115,12 @@ public class TestCatalog {
       catalog.dropTable(table);
     }
  }
+
+  public static boolean isConnectionIdRequired(String driverClass) {
+    return driverClass.equals(MySQLStore.class.getCanonicalName()) ||
+           driverClass.equals(MariaDBStore.class.getCanonicalName()) ||
+           driverClass.equals(PostgreSQLStore.class.getCanonicalName());
+  }
{noformat}

> Support PostgreSQL CatalogStore
> -------------------------------
>
>                 Key: TAJO-233
>                 URL: https://issues.apache.org/jira/browse/TAJO-233
>             Project: Tajo
>          Issue Type: New Feature
>          Components: catalog
>            Reporter: Hyunsik Choi
>            Assignee: Jihun Kang
>              Labels: newbie
>             Fix For: 0.9.1
>
>         Attachments: TAJO-233_Hyunsik_20141016.patch, postgresql.diff, 
> postgresql_oct.16.diff
>
>
> See the title. PostgreSQL is also an widely used open source DBMS. Like 
> TAJO-179, we need to support postgresql catalog store.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to