Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1030

Not supported JDBC APIs should return empty results instead of Exception

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: JDBC Driver
    • Labels:
      None

      Description

      Currently, some unsupported JDBC APIs throw Exception. They do not allow exiting JDBC like BI solutions to connect Tajo. So, we should change them to result in empty results with correct schemas.

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user babokim opened a pull request:

        https://github.com/apache/tajo/pull/145

        TAJO-1030: Not supported JDBC APIs should return empty results instead of Exception

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/babokim/tajo TAJO-1030

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tajo/pull/145.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #145


        commit b4a3d62006a6ebf485e56cbcd0201d450f1f9b69
        Author: HyoungJun Kim <babokim@babokim-macbook-pro.local>
        Date: 2014-09-17T13:04:43Z

        TAJO-1030: Not supported JDBC APIs should return empty results instead of Exception

        commit eb3f53d53987fc95eb5c6b5f07505047cde4c621
        Author: HyoungJun Kim <babokim@babokim-macbook-pro.local>
        Date: 2014-09-17T13:41:51Z

        Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

        commit b7d071c08f8d71c726bb417bfe92d3b2aad4c78a
        Author: HyoungJun Kim <babokim@babokim-macbook-pro.local>
        Date: 2014-09-17T14:09:44Z

        TAJO-1030: Not supported JDBC APIs should return empty results instead of Exception


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user babokim opened a pull request: https://github.com/apache/tajo/pull/145 TAJO-1030 : Not supported JDBC APIs should return empty results instead of Exception You can merge this pull request into a Git repository by running: $ git pull https://github.com/babokim/tajo TAJO-1030 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/145.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #145 commit b4a3d62006a6ebf485e56cbcd0201d450f1f9b69 Author: HyoungJun Kim <babokim@babokim-macbook-pro.local> Date: 2014-09-17T13:04:43Z TAJO-1030 : Not supported JDBC APIs should return empty results instead of Exception commit eb3f53d53987fc95eb5c6b5f07505047cde4c621 Author: HyoungJun Kim <babokim@babokim-macbook-pro.local> Date: 2014-09-17T13:41:51Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit b7d071c08f8d71c726bb417bfe92d3b2aad4c78a Author: HyoungJun Kim <babokim@babokim-macbook-pro.local> Date: 2014-09-17T14:09:44Z TAJO-1030 : Not supported JDBC APIs should return empty results instead of Exception
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on a diff in the pull request:

        https://github.com/apache/tajo/pull/145#discussion_r17787285

        — Diff: tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java —
        @@ -112,7 +113,7 @@ public int getScale(int column) throws SQLException {

        @Override
        public String getSchemaName(int column) throws SQLException {

        • throw new SQLFeatureNotSupportedException("getSchemaName not supported");
          + return "";
            • End diff –

        How about using 'public' as a default schema name? It's because PostgreSQL uses 'public' as a default schema and we would also use 'public' as a default schema if we should support schema.

        http://www.postgresql.org/docs/8.1/static/ddl-schemas.html

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/145#discussion_r17787285 — Diff: tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java — @@ -112,7 +113,7 @@ public int getScale(int column) throws SQLException { @Override public String getSchemaName(int column) throws SQLException { throw new SQLFeatureNotSupportedException("getSchemaName not supported"); + return ""; End diff – How about using 'public' as a default schema name? It's because PostgreSQL uses 'public' as a default schema and we would also use 'public' as a default schema if we should support schema. http://www.postgresql.org/docs/8.1/static/ddl-schemas.html
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/145#issuecomment-56184705

        The patch looks nice to me. Except for the default schema name, the patch appears to be ready to be committed.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/145#issuecomment-56184705 The patch looks nice to me. Except for the default schema name, the patch appears to be ready to be committed.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/145#issuecomment-57593654

        @babokim could you check this issue? If possible, I'd like to add this patch in 0.9.0.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/145#issuecomment-57593654 @babokim could you check this issue? If possible, I'd like to add this patch in 0.9.0.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user babokim commented on a diff in the pull request:

        https://github.com/apache/tajo/pull/145#discussion_r18328539

        — Diff: tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java —
        @@ -112,7 +113,7 @@ public int getScale(int column) throws SQLException {

        @Override
        public String getSchemaName(int column) throws SQLException {

        • throw new SQLFeatureNotSupportedException("getSchemaName not supported");
          + return "";
            • End diff –

        I also checked PostgreSQL jdbc driver. PostgreSQL returns a empty string.

        https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java

        Show
        githubbot ASF GitHub Bot added a comment - Github user babokim commented on a diff in the pull request: https://github.com/apache/tajo/pull/145#discussion_r18328539 — Diff: tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java — @@ -112,7 +113,7 @@ public int getScale(int column) throws SQLException { @Override public String getSchemaName(int column) throws SQLException { throw new SQLFeatureNotSupportedException("getSchemaName not supported"); + return ""; End diff – I also checked PostgreSQL jdbc driver. PostgreSQL returns a empty string. https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on a diff in the pull request:

        https://github.com/apache/tajo/pull/145#discussion_r18344162

        — Diff: tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java —
        @@ -112,7 +113,7 @@ public int getScale(int column) throws SQLException {

        @Override
        public String getSchemaName(int column) throws SQLException {

        • throw new SQLFeatureNotSupportedException("getSchemaName not supported");
          + return "";
            • End diff –

        Thank you for checking. Keep going.

        I misunderstood due to the following statements (http://www.postgresql.org/docs/9.2/static/ddl-schemas.html).

        ```In the previous sections we created tables without specifying any schema names. By default such tables (and other objects) are automatically put into a schema named "public". Every new database contains such a schema.```

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/145#discussion_r18344162 — Diff: tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java — @@ -112,7 +113,7 @@ public int getScale(int column) throws SQLException { @Override public String getSchemaName(int column) throws SQLException { throw new SQLFeatureNotSupportedException("getSchemaName not supported"); + return ""; End diff – Thank you for checking. Keep going. I misunderstood due to the following statements ( http://www.postgresql.org/docs/9.2/static/ddl-schemas.html ). ```In the previous sections we created tables without specifying any schema names. By default such tables (and other objects) are automatically put into a schema named "public". Every new database contains such a schema.```
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/145#issuecomment-57641454

        +1 Ship it.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/145#issuecomment-57641454 +1 Ship it.
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed. Thanks a lot for your contribution!

        Show
        hyunsik Hyunsik Choi added a comment - committed. Thanks a lot for your contribution!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tajo/pull/145

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/145
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #388 (See https://builds.apache.org/job/Tajo-master-build/388/)
        TAJO-1030: Not supported JDBC APIs should return empty results instead of Exception. (Hyoungjun Kim via hyunsik) (hyunsik: rev 029054b45c158159325a68ac1491256e3abe71f4)

        • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogConstants.java
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDatabaseMetaData.java
        • tajo-core/src/test/java/org/apache/tajo/jdbc/TestTajoDatabaseMetaData.java
        • CHANGES
        • tajo-common/src/main/java/org/apache/tajo/common/type/TajoTypeUtil.java
        • tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #388 (See https://builds.apache.org/job/Tajo-master-build/388/ ) TAJO-1030 : Not supported JDBC APIs should return empty results instead of Exception. (Hyoungjun Kim via hyunsik) (hyunsik: rev 029054b45c158159325a68ac1491256e3abe71f4) tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogConstants.java tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDatabaseMetaData.java tajo-core/src/test/java/org/apache/tajo/jdbc/TestTajoDatabaseMetaData.java CHANGES tajo-common/src/main/java/org/apache/tajo/common/type/TajoTypeUtil.java tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-CODEGEN-build #30 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/30/)
        TAJO-1030: Not supported JDBC APIs should return empty results instead of Exception. (Hyoungjun Kim via hyunsik) (hyunsik: rev 029054b45c158159325a68ac1491256e3abe71f4)

        • tajo-core/src/test/java/org/apache/tajo/jdbc/TestTajoDatabaseMetaData.java
        • tajo-common/src/main/java/org/apache/tajo/common/type/TajoTypeUtil.java
        • CHANGES
        • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogConstants.java
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDatabaseMetaData.java
        • tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-CODEGEN-build #30 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/30/ ) TAJO-1030 : Not supported JDBC APIs should return empty results instead of Exception. (Hyoungjun Kim via hyunsik) (hyunsik: rev 029054b45c158159325a68ac1491256e3abe71f4) tajo-core/src/test/java/org/apache/tajo/jdbc/TestTajoDatabaseMetaData.java tajo-common/src/main/java/org/apache/tajo/common/type/TajoTypeUtil.java CHANGES tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogConstants.java tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDatabaseMetaData.java tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-block_iteration-branch-build #15 (See https://builds.apache.org/job/Tajo-block_iteration-branch-build/15/)
        TAJO-1030: Not supported JDBC APIs should return empty results instead of Exception. (Hyoungjun Kim via hyunsik) (hyunsik: rev 029054b45c158159325a68ac1491256e3abe71f4)

        • tajo-core/src/test/java/org/apache/tajo/jdbc/TestTajoDatabaseMetaData.java
        • tajo-common/src/main/java/org/apache/tajo/common/type/TajoTypeUtil.java
        • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogConstants.java
        • CHANGES
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDatabaseMetaData.java
        • tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-block_iteration-branch-build #15 (See https://builds.apache.org/job/Tajo-block_iteration-branch-build/15/ ) TAJO-1030 : Not supported JDBC APIs should return empty results instead of Exception. (Hyoungjun Kim via hyunsik) (hyunsik: rev 029054b45c158159325a68ac1491256e3abe71f4) tajo-core/src/test/java/org/apache/tajo/jdbc/TestTajoDatabaseMetaData.java tajo-common/src/main/java/org/apache/tajo/common/type/TajoTypeUtil.java tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogConstants.java CHANGES tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDatabaseMetaData.java tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSetMetaData.java

          People

          • Assignee:
            hjkim Hyoungjun Kim
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development