You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Eric Evans (JIRA)" <ji...@apache.org> on 2011/02/07 18:07:57 UTC

[jira] Created: (CASSANDRA-2124) JDBC driver for CQL

JDBC driver for CQL
-------------------

                 Key: CASSANDRA-2124
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
             Project: Cassandra
          Issue Type: New Feature
          Components: API
            Reporter: Eric Evans
            Priority: Minor


A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993333#comment-12993333 ] 

Jonathan Ellis commented on CASSANDRA-2124:
-------------------------------------------

... although, it may be useful to extract what CliClient is already doing there (using describe_keyspace).

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999426#comment-12999426 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Facing 1 issue with LongType decoder:

Query i am trying:

"UPDATE IndexedTable SET \"birthdate\" = 1000L WHERE KEY = 100L".

Was giving issue for long type. Looking further i can see that

QueryProcessor->batchUpdate() method.

validateColumn is called with column.getKey().getByteBuffer() as a parameter. Should it be

column.getValue().getByteBuffer()? Not sure but i was able to parse query successfully with this change.

Should we validate column value rather than it's name?

But still for selectquery

SELECT \"birthdate\" FROM IndexedTable WHERE KEY=100L. It is same error.

Again it is same thing, Should we validate column value rather than it's name?

QueryProcessor->getSlice method is doing the same.


Suggest, if i am trying with CQL in incorrect way.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008017#comment-13008017 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

I believe CassandraStatement is PreparedStatement. CASSANDRA-2277 is for queryParameterization, i think.
Yes, that can be clubbed together with that.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008014#comment-13008014 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

IMO, that falls under implementing a proper PreparedStatement interface.  This is currently what I envision for CASSANDRA-2277.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003424#comment-13003424 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

The other option would be to declare the JDBC driver, _The_ driver, and fold {{o.a.c.cql.driver.Connection}} and friends into it.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008018#comment-13008018 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

bq. I believe CassandraStatement is PreparedStatement.
Yes, it currently is.  I think the code will be more maintainable if it is broken out.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Assigned: (CASSANDRA-2124) JDBC driver for CQL

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

Eric Evans reassigned CASSANDRA-2124:
-------------------------------------

    Assignee: Vivek Mishra

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v2-0001-first-pass-at-column-decoding.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993970#comment-12993970 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Exposing a method in Connection class is not be a good idea, i guess

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992619#comment-12992619 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------


bq. 1) Modified files as per (http://wiki.apache.org/cassandra/CodeStyle).

With respect to code style, a newline should also follow a closing brace, so wherever you have:

{code:style=Java}
if(foo)
{
    doFoo();
} else
{
    doBar();
}
{code}

It should become:

{code:style=Java}
if(foo)
{
    doFoo();
}
else
{
    doBar();
}
{code}

bq. 2) As suggested by Eric, moved source code into driver/java/src (alongwith existing source code).

Sorry, I should have been clearer here.  I think the {{.jdbc}} suffixed package name (like you had it) is best, I just meant that it should live under {{drivers/java}}.  So either {{o.a.c.cql.driver.jdbc}}, or {{o.a.c.cql.jdbc}} would be OK with me.

{quote}
4) Modified build.xml to include driver/java/test/JdbcDriverTest as part of target run "build-test".

Note: Still it is not part of "ant test" target.
{quote}

Yeah, it's somewhat awkward in that it needs to connect to a running instance of Cassandra.  I wonder if {{o.a.c.service.EmbeddedCassandraService}} would be of help here.

Also, JUnit should invoke setUp() and tearDown() for you, so I think you could rename {{setUpInternal()}} to {{setUp()}}, and remove all of the per-test invocations of it and {{tearDown()}}.

----

Additionally, it looks like {{CassandraResultSet}} creates String instances for column names and values, which is really going to limit the utility.  Do you have plans to change that?

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998487#comment-12998487 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

plaaning to add support for getBigDecimal(), getBytes etc in CassandraResultSet using above mentioned logic.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991892#comment-12991892 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

First version of patch attached. It includes:
1) jdbc api with basic methods implementation.
2) Added test case JdbcTest to test functionality.
3) Precondition added to run test case.
4) Change of port and host will be required in case it is not on default(e.g. localhost@9160).


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v1-0004-more-comments-in-ColumnDecoder.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

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

Hudson commented on CASSANDRA-2124:
-----------------------------------

Integrated in Cassandra #776 (See [https://hudson.apache.org/hudson/job/Cassandra/776/])
    

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Eric Evans updated CASSANDRA-2124:
----------------------------------

    Reviewer: urandom

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Vivek Mishra updated CASSANDRA-2124:
------------------------------------

    Attachment: cassandra_generic_decoder.patch

Draft patch with logic for column decoding as discussed.

This is not final patch as i need to correct code style check and test case around it.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992461#comment-12992461 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

cassandra-0.7.1-2124_v2.0 includes:
1) Modified files as per (http://wiki.apache.org/cassandra/CodeStyle).
2) As suggested by Eric, moved source code into driver/java/src (alongwith existing source code).
3) Moved JdbcDriverTest to driver/java/test.
4) Modified build.xml to include driver/java/test/JdbcDriverTest as part of target run "build-test".

Note: Still it is not part of "ant test" target.





> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992997#comment-12992997 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Patch attached:
1) Code style comments suggested by Eric, has been incorporated.

2) Sorry, I should have been clearer here. I think the .jdbc suffixed package name (like you had it) is best, I just meant that it should live under drivers/java. So either o.a.c.cql.driver.jdbc, or o.a.c.cql.jdbc would be OK with me.
<vivek> refactored to move into o.a.c.cql.driver.jdbc.</vivek>

Yeah, it's somewhat awkward in that it needs to connect to a running instance of Cassandra. I wonder if o.a.c.service.EmbeddedCassandraService would be of help here.
<vivek> Done. Test running with EmbeddedCassandraService().</vivek>

Also, JUnit should invoke setUp() and tearDown() for you, so I think you could rename setUpInternal() to setUp(), and remove all of the per-test invocations of it and tearDown().
<vivek> done</vivek>

Additionally, it looks like CassandraResultSet creates String instances for column names and values, which is really going to limit the utility. Do you have plans to change that?
<vivek> Changes made. Thought to add generics with in place of Object, but seems overhead.</vivek>

•what is the purpose of replacing/setting the security manager in CassandraDriver?
<vivek> Reason to add this was as initially thought to introduce remote interface layer on top of driver. Now removed. </vivek>





> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

       

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001977#comment-13001977 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

| I figured it would be easier to maintain the current schema info if the decoder weren't static. That way when a new connection is established, new schema is loaded. Otherwise, we'd need to figure out a way to update the static/singleton.

Ok. Now i understand, reason to hold this with connection instance is make it reusable with other future drivers, if reqd.

|To use the ResultSet.getXXX(String) methods, we need a way to map column names to strings.

For this, either we need to introduce a wrapper or Ascii, BytesType, UUID etc. classes need to provide a way for toString() calls.

Let me know, if i can take a look on something which pops up on your mind.




> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v1-0001-first-pass-at-column-decoding.txt, v1-0002-clean-up-JdbcDriverTest.txt, v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v1-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992060#comment-12992060 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

There is a lot to go through here, but just to get things started I'd point you at the code style guide (http://wiki.apache.org/cassandra/CodeStyle).

Also, at least for now, let's put this alongside the existing driver source in {{driver/java/src}} (the unit test can go in {{driver/java/test}}).

Thanks Vivek!

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001935#comment-13001935 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Hi Gary,
Should we hold a decoder instance with Connection  or it should be a static call? 
Passing Decoder instance to CassandraResultSet is required, why?

Planning for ResultSetMetadata API? CassandraResultSet does not need column name decoding(only value decoding), i think.


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v1-0001-first-pass-at-column-decoding.txt, v1-0002-clean-up-JdbcDriverTest.txt, v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v1-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994900#comment-12994900 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

bq. 1. BytesType (to be decoded as String ?)

These should be returned as-is (as ByteBuffers).

{quote}
1.a. AsciiType (to be decoded as String ?)
1.b. UTF8Type (to be decoded as String ?) 
{quote}

As strings, yes.  Values of type UTF8Type should be decoded using the utf8 charset.

bq. 2. IntegerType (to be decoded as Integer?)

java.math.BigInteger

{quote}
3. LexicalUUIDType (to be decoded as String ?)
5. TimeUUIDType (to be decoded as Date ?)
{quote}

java.util.UUID

bq. 4. LongType (to be decoded as Long ?) 

Yes

bq. 6. LocalByPartionerType (Not sure)

You can disregard this one.

{quote}
While executing a cql query, we need to know it's column family name. So that we can ask DefaultDecoder to return all column names with correct decoding(mentioned above). Ways to retrieve this is :
1) Use CqlParser to get Statement and retrieve it from StatementType.(Same way as it is done in QueryProcessor).
{quote}

This is pretty heavy-weight because it not only means including all of {{o.a.c.cql}} in the drivers jar, but requiring its dependencies as well (antlr at least).

bq. 2. Writing a logic to retrieve ColumnFamily name via substring of cql query does not make any sense.

I don't think it's too bad.  You're talking about a couple of very trivial, pre-compiled regexes (one for {{USE}} to track the current keyspace, and one for {{SELECT}} to get the columnfamily).  For what it's worth, drivers written in other languages are faced with solving the same problem, and utilizing the node-side parser is not an option for them.

bq. 3. Is there a way to get ColumnFamily Name from CqlResult/CqlRow itself?.

This strikes as me as wasteful since the results will always correlate to a single column family, (and we shouldn't need the node to tell us).


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007461#comment-13007461 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

Let's move any ResultSetMetaData discussion over to CASSANDRA-2302.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999563#comment-12999563 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

bq. One quick question, column name and column value both should be decoded in CassandraResultSet?. Decoding a column name will be an advantage(thinking from jdbc perspective)

Both, yes.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Vivek Mishra updated CASSANDRA-2124:
------------------------------------

    Attachment: cassandra-0.7.1-2124_v2.1

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

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

Hudson commented on CASSANDRA-2124:
-----------------------------------

Integrated in Cassandra #723 (See [https://hudson.apache.org/hudson/job/Cassandra/723/])
    

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006914#comment-13006914 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

bq. Should we replace rowmetadata with ResultsetMetaData?
The problem with using ResultSetMetaData is that it is a bad interface for Cassandra's sparse columns.  A good example is that column 0 in one row might map to a column named "foo", while column 0 in another row might map to a column named "bar".  The Wrappable interface exists so that JDBC driver implementations can provide features beyond the JDBC API without the ugliness of casting.  I think it is better to make the programmer fully aware that he is dealing with sparse columns and forcing him to use the RowMetaData API.

I'd like to hear your points on the benefits of using ResultSetMetaData though.  I admit that RowMetaData may not be the ideal way of accessing row-specific meta information.


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006945#comment-13006945 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

Ok. I reopened CASSANDRA-2302.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008010#comment-13008010 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Support for addBatch() and executeBatch() for JDBC driver. 
Planning to add this support. Shall i open and link a JIRA task for this?

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Eric Evans updated CASSANDRA-2124:
----------------------------------

    Reporter: Gary Dusbabek  (was: Eric Evans)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Gary Dusbabek
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994007#comment-12994007 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

Right, the problem with adding a method is that folks will use it, and this is only a temporary measure.

Going back to my idea of pluggable result decoders, a default/automatic decoder (one that configured itself based on the schema) could create it's own (private )thrift client to perform the {{describe_keyspace()}} call, and since the methods that do the decoding can be static, this only needs to be done once.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Issue Comment Edited: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003408#comment-13003408 ] 

Eric Evans edited comment on CASSANDRA-2124 at 3/7/11 4:02 PM:
---------------------------------------------------------------

bq. That's what happens in `CassandraStatement.execute()` when it returns a `CassandraResultSet` (the magic is in `CassandraResultSet.next()`.)

Sorry, I meant so that {{o.a.c.cql.driver.Connection}} returned a wrapper that produced decoded results, instead of exposing the raw Thrift results.

Same for the exceptions, I was suggesting that {{o.a.c.cql.driver.Connection.execute()}} should catch the Thrift exceptions and raise something in our namespace.

      was (Author: urandom):
    bq. That's what happens in `CassandraStatement.execute()` when it returns a `CassandraResultSet` (the magic is in `CassandraResultSet.next()`.)

Sorry, I meant so that {{o.a.c.cql.driver.Connection}} returned a wrapper that produced decoded results, instead of exposing the raw Thrift results.

Same for the exceptions, I suggesting that {{o.a.c.cql.driver.Connection.execute()}} should catch the Thrift exceptions and raise something in our namespace.
  
> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000401#comment-13000401 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Patch attached with comments incorporated.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003396#comment-13003396 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

bq. I get failures of `o.a.c.db.SerializationsTest`.
Careless modifications to `test/conf/cassandra.yaml` did that.  Fixed in v2.

bq. Would it make sense to wrap the Thrift results from o.a.c.cql.driver.Connection in something that returned decoded results?
That's what happens in `CassandraStatement.execute()` when it returns a `CassandraResultSet` (the magic is in `CassandraResultSet.next()`.)

bq. I guess you'd also need to wrap the Thrift exceptions thrown by `o.a.c.cql.driver.Connection.execute()`
That is what is being done.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment: v3-0004-more-comments-in-ColumnDecoder.txt
                v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt
                v3-0002-clean-up-JdbcDriverTest.txt
                v3-0001-first-pass-at-column-decoding.txt

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006919#comment-13006919 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

bq. do we support resultsetmetadata for "mostly static" CFs?
No.  If we did, I'd be in favor for the results [of the RSMD methods] to be indicative of the current row of the result set.  This would satisfy the "mostly static" results and also the "mostly sparse" results.

e.g. {code}
ResultSet rs = stmt.executeQuery("SELECT ...");
ResultSetMetaData md = rs.getResultSetMetaData();
while (rs.next()) {
  md.getColumnName(0); // refers to the current row of rs, not every row of rs.
}
{code}

methods like getType() will still apply to the entire result set.



> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992627#comment-12992627 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Additionally, it looks like CassandraResultSet creates String instances for column names and values, which is really going to limit the utility. Do you have plans to change that?

<vivek>Yes, as intially provided implementation for getString() method. will change it to hold Object inplace of String.</vivek>

Yeah, it's somewhat awkward in that it needs to connect to a running instance of Cassandra. I wonder if o.a.c.service.EmbeddedCassandraService would be of help here.

<vivek> Will use EmbeddedCassandraService for test.</vivek>

Will also make other changes in next patch.

Thanks Eric!


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993969#comment-12993969 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

although, it may be useful to extract what CliClient is already doing there (using describe_keyspace).

<vivek>
Currently Connection class is holding reference to Client. So to make a call to method "describe_keyspace".
Do we need to expose a method within Connection class? or should i use reflection to invoke method on client?
</vivek>


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006939#comment-13006939 ] 

Jonathan Ellis commented on CASSANDRA-2124:
-------------------------------------------

I like that idea a lot.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992694#comment-12992694 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

This is a really great start!
* what is the purpose of replacing/setting the security manager in CassandraDriver?

I think the next step is to get some type-awareness from the CF comparators.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999525#comment-12999525 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

{quote}
- name: IndexedTable 
compare_with: LongType
issue is:
{why: expected 8 or 0 long(9)}. something like this.
{quote}

Right, the comparator is for the column _name_, which in your previous example was "birthdate". It fails to validate because a long is 8 bytes in length and "birthdate" is 9 bytes.  Validators apply to column values, if you have not configured a default validator, _or_ a column specific one (using column_metadata), then it is {{BytesType}} (i.e. no validation).

{quote}
Yes. i can see that both are validated. but from batchUpdate method, call is
validateColumn(keyspace, update.getColumnFamily(), column.getKey().getByteBuffer());
{quote}

{{getKey()}} is a method of {{java.util.Map.Entry}}, it returns the column name (the "key" in this entry), because we're iterating over a map of columns.  This code is working correctly.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v1-0002-clean-up-JdbcDriverTest.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002253#comment-13002253 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

bq. For this, either we need to introduce a wrapper or Ascii, BytesType, UUID etc. classes need to provide a way for toString() calls.

for AsciiType use getString(), for BytesType use getBytes(), for UUID use getObject and cast to a java.util.UUID.

I think this patch set is ready to commit and we can move on to the next iteration (ResultSetMetadata or whatever).

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v1-0001-first-pass-at-column-decoding.txt, v1-0002-clean-up-JdbcDriverTest.txt, v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v1-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Vivek Mishra updated CASSANDRA-2124:
------------------------------------

    Attachment: cassandra-0.7.1-2124_v2.0

Patch added as comments provided by Eric

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999475#comment-12999475 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

{quote}
Facing 1 issue with LongType decoder:

Query i am trying:

"UPDATE IndexedTable SET \"birthdate\" = 1000L WHERE KEY = 100L".

Was giving issue for long type. Looking further i can see that
{quote}

What kind of issue are you having?  What is the comparator for this column family (applied to column names)?  What is the default validator, or the specific one for column "birthdate" (applies to column values)?

{quote}
QueryProcessor->batchUpdate() method.

validateColumn is called with column.getKey().getByteBuffer() as a parameter. Should it be

column.getValue().getByteBuffer()? Not sure but i was able to parse query successfully with this change.
{quote}

This is looping over {{Map.Entry}} columns, so {{getKey()}} is returning the column name, and {{getValue()}} the column value.

{quote}
Should we validate column value rather than it's name?

But still for selectquery

SELECT \"birthdate\" FROM IndexedTable WHERE KEY=100L. It is same error.

Again it is same thing, Should we validate column value rather than it's name?

QueryProcessor->getSlice method is doing the same.

Suggest, if i am trying with CQL in incorrect way.
{quote}

Both column names and values are validated against subclasses of {{o.a.c.marshal.AbstractType}}, configured as comparators or validators respectively.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993298#comment-12993298 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

I think, Getting metadata for CF etc should be independent from jdbc driver. Better to introduce these alongwith API which produces CqlResult, Row etc?

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003408#comment-13003408 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

bq. That's what happens in `CassandraStatement.execute()` when it returns a `CassandraResultSet` (the magic is in `CassandraResultSet.next()`.)

Sorry, I meant so that {{o.a.c.cql.driver.Connection}} returned a wrapper that produced decoded results, instead of exposing the raw Thrift results.

Same for the exceptions, I suggesting that {{o.a.c.cql.driver.Connection.execute()}} should catch the Thrift exceptions and raise something in our namespace.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Vivek Mishra updated CASSANDRA-2124:
------------------------------------

    Attachment: cassandra_generic_decoder_v1.1.patch

@Gary:
<I think that calling describe_keyspace() for every statement is going to impact performance very negatively. At the very least, there should be some caching going on there.>

i am moving it to CassandraConnection. Do we still need to put caching there? Introducing connection pooling should take care of this. Getting a new connection instance should make call to "describe_key_space".

< relying on a regex to figure out the keyspace is brittle>
This is for extracting column family from cql query.


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v2-0002-clean-up-JdbcDriverTest.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993332#comment-12993332 ] 

Jonathan Ellis commented on CASSANDRA-2124:
-------------------------------------------

bq. CQL will need a means to query for schema information, but for now, that could be obtained using raw Thrift and the describe_keyspace(String keyspace) RPC method.

Agreed, -1 on premature generalization

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004774#comment-13004774 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

lgtm. +1

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v1-0001-first-pass-at-column-decoding.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006997#comment-13006997 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Ok. Additionally, for methods like:
getTableName(int column) and getSchemaName(int column) should we implement them to return Column family and Keyspace respectively?

Not analyzed yet, but planning to add addBatch(), executeBatch calls on CassandraStatement.


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Vivek Mishra updated CASSANDRA-2124:
------------------------------------

    Attachment: Cassandra-2124_v1.0

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008023#comment-13008023 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Is it worth adding support for methods in CassandraResultSet:
1)previous()
2)findColumn(String arg0)
3) getByte(String arg0)
etc.?

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Vivek Mishra updated CASSANDRA-2124:
------------------------------------

    Attachment: Cassandra_2124_decoder.patch

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v2-0004-more-comments-in-ColumnDecoder.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994775#comment-12994775 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Eric,
I was looking into implementation of ColumnDecoder.
Available types for decoding:

1. BytesType   (to be decoded as String ?)
    1.a. AsciiType (to be decoded as String ?)
    1.b. UTF8Type  (to be decoded as String ?)  
2. IntegerType     (to be decoded as Integer?)
3. LexicalUUIDType (to be decoded as String ?)
4. LongType        (to be decoded as Long ?)  
5. TimeUUIDType    (to be decoded as Date ?)
6. LocalByPartionerType (Not sure)


Now looking into these types, it looks to me that by default all of them are decoded toString().

Let me know, if above decoding logic make sense.

While executing a cql query, we need to know it's column family name. So that we can ask DefaultDecoder to return all column names with correct decoding(mentioned above). Ways to retrieve this is :
1) Use CqlParser to get Statement and retrieve it from StatementType.(Same way as it is done in QueryProcessor).

2. Writing a logic to retrieve ColumnFamily name via substring of cql query does not make any sense.

3. Is there a way to get ColumnFamily Name from CqlResult/CqlRow itself?.






> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] [Commented] (CASSANDRA-2124) JDBC driver for CQL

Posted by "Tony Bringardner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031817#comment-13031817 ] 

Tony Bringardner commented on CASSANDRA-2124:
---------------------------------------------

I did not see this issue earlier (my bad) and I have been working on a JDBC driver using Cassandra 0.7.4.  It originally used Hector to access Cassandra but now uses Cassandra.client. 

It’s not complete by any means but it is fairly functional.  It has support for an expanded set of types using a column family to store type info.  It also supports Metadata (Database and ResultSet) .

My objective was to introduce Cassandra into our datacenter but have developers write code using standard Spring JDBC template.  

Is there any interest?


> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8 beta 1
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993324#comment-12993324 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

bq. I think, Getting metadata for CF etc should be independent from jdbc driver. Better to introduce these alongwith API which produces CqlResult, Row etc?

CQL will need a means to query for schema information, but for now, that could be obtained using raw Thrift and the {{describe_keyspace(String keyspace)}} RPC method.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993099#comment-12993099 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

{quote}
Was thinking to add "CREATE TABLE <CF>" for CREATE COLUMN FAMILY calls.
I have made code changes for this. Modified files are:
1) Cql.g
2) Auto generated CqlParser.
3) QueryProcessor
4) StatementType.
{quote}

Are you aware of CASSANDRA-1709? I'm just about finished with that (CREATE COLUMNFAMILY anyway).

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006915#comment-13006915 ] 

Jonathan Ellis commented on CASSANDRA-2124:
-------------------------------------------

do we support resultsetmetadata for "mostly static" CFs?

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999784#comment-12999784 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Patch added for generic decoder. Added test for LongType and IntegerType.
I have added decoding for column values only.
Methods provided by resultset api are getXXX(int index) getXXX(String name).

So thinking column name should be decoded as string. 

Introducing ResultSetMetaData will definitly need decoding for column name and value?

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002896#comment-13002896 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

It is very strange, but with these patches applied I get failures of {{o.a.c.db.SerializationsTest}}.  Is anyone else seeing that?

Would it make sense to wrap the Thrift results from {{o.a.c.cql.driver.Connection}} in something that returned decoded results?  This is how the Python driver works FWIW.

You wouldn't need to expose the current keyspace, column family, or decoder, and hiding the Thrift instances behind a Rows proxy like that would make it easier later on to replace Thrift with our own protocol.

On that note, I guess you'd also need to wrap the Thrift exceptions thrown by {{o.a.c.cql.driver.Connection.execute}}  (the Python driver does that too).



> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v1-0001-first-pass-at-column-decoding.txt, v1-0002-clean-up-JdbcDriverTest.txt, v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v1-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment: v2-0004-more-comments-in-ColumnDecoder.txt
                v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt
                v2-0002-clean-up-JdbcDriverTest.txt
                v2-0001-first-pass-at-column-decoding.txt

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999547#comment-12999547 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Thanks Eric.
I got it clarified now. 
One quick question, column name and column value both should be decoded in CassandraResultSet?. Decoding a column name will be an advantage(thinking from jdbc perspective)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993319#comment-12993319 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

bq. Suggest if creating subtask for these would be a good idea, as there is lot of things needs to be put in going ahead.

Sure, sounds good.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006811#comment-13006811 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Should we replace rowmetadata with ResultsetMetaData?

It will make it JDBC compliant. So calls like unwrap() will be replaced rs.getMetadata()(with some additional features)



> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>             Fix For: 0.8
>
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000369#comment-13000369 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

I took at look at Cassandra_2124_decoder.patch this morning.  I think that calling describe_keyspace() for every statement is going to impact performance very negatively.  At the very least, there should be some caching going on there, and that relying on a regex to figure out the keyspace is brittle.  It would be better to make the describe_keyspace() call once in CassandraConnection constructor.

Other things: ColumnDecoder.describe_key_Space() needs to conform to the project coding conventions.  There seem to be copious amounts of whitespace/comment/javadoc changes.  If you're going to include them, put them all in a separate patch at the end.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment:     (was: v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v2-0001-first-pass-at-column-decoding.txt, v2-0002-clean-up-JdbcDriverTest.txt, v2-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v2-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993297#comment-12993297 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Thanks Eric.

it is just to startwith. need to put in a lot of things.

What I had planned to do for the generic driver (o.a.c.cql.driver.Connection), was to introduce the notion of a pluggable result decoder. The default decoder would introspect the schema (comparators and/or validators) to configure itself for the right types. I'm not sure how something like that could be applied to a JDBC driver though.

I think what we are talking here is something like resultSetMetadata/metadata for decode. Yes that is next on list. 

Suggest if creating subtask for these would be a good idea, as there is lot of things needs to be put in going ahead.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Eric Evans updated CASSANDRA-2124:
----------------------------------

    Reviewer: gdusbabek  (was: urandom)
    Reporter: Eric Evans  (was: Gary Dusbabek)

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997544#comment-12997544 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

I didn't spend a great deal of time looking at this since you've indicated that it's a work in-progress, but one thing worth mentioning is that I think the decoder should exist as a part of the vanilla driver, where it can be used by the JDBC one (much the way {{o.a.c.cql.driver.Connection}} is).

Also, I'm not sure what your comfort level is with reading Python, but I committed a result decoder to the Python driver recently.  I'm not married to anything that was done there (in fact, I feel certain it could use some improvement), but I mention it because it would be nice to sync the two up as much as possible.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999494#comment-12999494 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

This is the definition for columnFamily.

        - name: IndexedTable 
          compare_with: LongType
issue is:
{why: expected 8 or 0 long(9)}. something like this.

Yes. i can see that both are validated. but from batchUpdate method, call is
validateColumn(keyspace, update.getColumnFamily(), column.getKey().getByteBuffer());

giving me error like

{why: expected 8 or 0 long(9)}.

I belive this is only validating column name not it's value.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Updated: (CASSANDRA-2124) JDBC driver for CQL

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

Gary Dusbabek updated CASSANDRA-2124:
-------------------------------------

    Attachment: v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v3-0001-first-pass-at-column-decoding.txt, v3-0002-clean-up-JdbcDriverTest.txt, v3-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v3-0004-more-comments-in-ColumnDecoder.txt, v3-0005-move-all-java-cql-into-jdbc-package-and-only-expose-.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993253#comment-12993253 ] 

Eric Evans commented on CASSANDRA-2124:
---------------------------------------

Obviously there is a lot more that can be done here, but this is a great start, so I went ahead and committed your latest. Thanks for the contribution!

{quote}
>> Additionally, it looks like CassandraResultSet creates String instances for column names and values,
>> which is really going to limit the utility. Do you have plans to change that?
>>
> Changes made. Thought to add generics with in place of Object, but seems overhead.
{quote}

Using Object for {{valueMap}} here isn't going to change much since {{next()}} still marshals the returned values to String.

What I had planned to do for the generic driver ({{o.a.c.cql.driver.Connection}}), was to introduce the notion of a pluggable result decoder.  The default decoder would introspect the schema (comparators and/or validators) to configure itself for the right types.  I'm not sure how something like that could be applied to a JDBC driver though.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001974#comment-13001974 ] 

Gary Dusbabek commented on CASSANDRA-2124:
------------------------------------------

bq. Should we hold a decoder instance with Connection or it should be a static call? 
I figured it would be easier to maintain the current schema info if the decoder weren't static.  That way when a new connection is established, new schema is loaded.  Otherwise, we'd need to figure out a way to update the static/singleton.

bq. Passing Decoder instance to CassandraResultSet is required, why?
Because that is where the decoding is actually done.

bq. Planning for ResultSetMetadata API? 
Yes. Baby steps for now.

bq. CassandraResultSet does not need column name decoding(only value decoding), i think.
To use the ResultSet.getXXX(String) methods, we need a way to map column names to strings.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v1-0001-first-pass-at-column-decoding.txt, v1-0002-clean-up-JdbcDriverTest.txt, v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v1-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998485#comment-12998485 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Hi Eric,
Looked into python decoder as a newbie to python. 
But it looks to me as :
1) Decode column value using column family validator and comparator.

Same is with java decoder

Logic is :

1) On invocation of CassandraStatement execution, make static call to ColumnDecoder with query and keyspace.
2) Implicitly retrieve column family using pattern matching.
3) CassandraResultSet.next() method is changed to pick columnValue from ColumnDecoder.getColumnValue(col.getValue()).

This automatically decodes(cast) object into required format.

I can see that it looks to me both (py and java) more or less on same path.


Having something like describe_column_family later can be a big thing.



> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992998#comment-12992998 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------


Was thinking to add "CREATE TABLE <CF>" for CREATE COLUMN FAMILY calls.
I have made code changes for this. Modified files are:
1) Cql.g
2) Auto generated CqlParser.
3) QueryProcessor
4) StatementType.

Suggest, if this can be thought as a feature as part of CRUD support.

Vivek

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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

        

[jira] Commented: (CASSANDRA-2124) JDBC driver for CQL

Posted by "Vivek Mishra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002621#comment-13002621 ] 

Vivek Mishra commented on CASSANDRA-2124:
-----------------------------------------

Please commit your patch. i will start working on ResultSetMetadata.

Thanks Gary for clarifying Column name and value decoding requirement.

> JDBC driver for CQL
> -------------------
>
>                 Key: CASSANDRA-2124
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2124
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Eric Evans
>            Assignee: Vivek Mishra
>            Priority: Minor
>              Labels: cql
>         Attachments: Cassandra-2124_v1.0, Cassandra_2124_decoder.patch, cassandra-0.7.1-2124_v2.0, cassandra-0.7.1-2124_v2.1, cassandra_generic_decoder.patch, cassandra_generic_decoder_v1.1.patch, v1-0001-first-pass-at-column-decoding.txt, v1-0002-clean-up-JdbcDriverTest.txt, v1-0003-implements-getXXX-methods-to-return-values-of-the-corr.txt, v1-0004-more-comments-in-ColumnDecoder.txt
>
>
> A simple connection class and corresponding pool was created for CQL as a part of CASSANDRA-1710, but a JDBC driver (either in addition to, or as a replacement for) would also be interesting.

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