You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Patrick Hunt (JIRA)" <ji...@apache.org> on 2011/08/08 23:44:27 UTC

[jira] [Created] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
------------------------------------------------------------------------------

                 Key: HIVE-2358
                 URL: https://issues.apache.org/jira/browse/HIVE-2358
             Project: Hive
          Issue Type: Bug
          Components: JDBC
    Affects Versions: 0.8.0
            Reporter: Patrick Hunt
            Assignee: Patrick Hunt
             Fix For: 0.8.0


My patch for HIVE-1631 did not ensure the following (from comment on 1631):
-------------
Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42

Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column

Without Patch on a FLOAT Column
--------------------------------
DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0

ResultSetMetaData.getPrecision() returns 0
ResultSetMetaData.getScale() returns 0

With Patch on a FLOAT Column
----------------------------
DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0

ResultSetMetaData.getPrecision() returns 7
ResultSetMetaData.getScale() returns 7

Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13081744#comment-13081744 ] 

Patrick Hunt commented on HIVE-2358:
------------------------------------

Thanks Mythili, based on your previous comment you consider this valid output? (i.e. consistent). Do the values themselves seem reasonable to you? Are you ok for this patch to get committed?

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084946#comment-13084946 ] 

Carl Steinbach commented on HIVE-2358:
--------------------------------------

+1. Will commit if tests pass.

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-2358:
---------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

Committed to trunk. Thanks Patrick!

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Mythili Gopalakrishnan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082135#comment-13082135 ] 

Mythili Gopalakrishnan commented on HIVE-2358:
----------------------------------------------

Yes Patrick, I am OK for this patch to get committed. 

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated HIVE-2358:
-------------------------------

    Attachment: HIVE-2358.patch

This patch fixes the problem identified by Mythili and also adds testing to verify.

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Mythili Gopalakrishnan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13081610#comment-13081610 ] 

Mythili Gopalakrishnan commented on HIVE-2358:
----------------------------------------------

Tested this patch and here are my results.

With Patch  HIVE-2358 on a FLOAT Column
---------------------------------------
DatabaseMetaData.getColumns () COLUMN_SIZE returns 7
DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 7

ResultSetMetaData.getPrecision() returns 7
ResultSetMetaData.getScale() returns 7

With Patch  HIVE-2358 on a DOUBLE Column
---------------------------------------
DatabaseMetaData.getColumns () COLUMN_SIZE returns 15
DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 15

ResultSetMetaData.getPrecision() returns 15
ResultSetMetaData.getScale() returns 15

--Mythili

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13085044#comment-13085044 ] 

Hudson commented on HIVE-2358:
------------------------------

Integrated in Hive-trunk-h0.21 #896 (See [https://builds.apache.org/job/Hive-trunk-h0.21/896/])
    HIVE-2358. JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types (Patrick Hunt via cws)

cws : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1157728
Files : 
* /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
* /hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcColumn.java
* /hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.java


> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated HIVE-2358:
-------------------------------

    Status: Patch Available  (was: Open)

> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2358) JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082697#comment-13082697 ] 

jiraposter@reviews.apache.org commented on HIVE-2358:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1459/
-----------------------------------------------------------

Review request for hive and Carl Steinbach.


Summary
-------

make the returned values consistent.


This addresses bug HIVE-2358.
    https://issues.apache.org/jira/browse/HIVE-2358


Diffs
-----

  jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.java 2aa7727 
  jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcColumn.java 43cc2a3 
  jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java d72cf43 

Diff: https://reviews.apache.org/r/1459/diff


Testing
-------

added new unit tests


Thanks,

Patrick



> JDBC DatabaseMetaData and ResultSetMetaData need to match for particular types
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-2358
>                 URL: https://issues.apache.org/jira/browse/HIVE-2358
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 0.8.0
>
>         Attachments: HIVE-2358.patch
>
>
> My patch for HIVE-1631 did not ensure the following (from comment on 1631):
> -------------
> Mythili Gopalakrishnan added a comment - 08/Aug/11 08:42
> Just tested this fix and does NOT work correctly. Here are my findings on a FLOAT column
> Without Patch on a FLOAT Column
> --------------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 12
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 0
> ResultSetMetaData.getScale() returns 0
> With Patch on a FLOAT Column
> ----------------------------
> DatabaseMetaData.getColumns () COLUMN_SIZE returns 24
> DatabaseMetaData.getColumns () DECIMAL_DIGITS - returns 0
> ResultSetMetaData.getPrecision() returns 7
> ResultSetMetaData.getScale() returns 7
> Also both DatabaseMetadata and ResultSetMetaData must return the same information for Precision and Scale for FLOAT,DOUBLE types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira