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

Sam Tunnicliffe commented on CASSANDRA-9400:
--------------------------------------------

We should wait for 
[JAVA-404|https://datastax-oss.atlassian.net/browse/JAVA-404] to be committed 
before incorporating the custom jar, just in case of further changes on the 
driver side. In the meantime, I've a few remarks on the patch:

* adding support for the new types in {{CqlRecordReader}} should probably be 
broken out into a separate ticket. But if we're going to shoehorn it in here, 
can we look at improving the coverage of {{CqlRecordReaderTest}} to check all 
the supported datatypes.

* can we now enable {{UFTest#testFunctionExecutionExceptionNet}}? As with the 
previous comment, maybe we ought to make that a separate ticket but I'd be ok 
with doing it here.

* the new {{UFTest#testTypesWithAndWithoutNulls}} is pretty hard to follow. It 
would add a bit of boilerplate, but perhaps adding a simple struct and making 
{{typeDefs}} an array of those would make the test more readable.

* the {{maxProtocolVersion}} logic in CQLTester is already incorrect and this 
(temporary) hack to skip v4 while driver support is incomplete doesn't help 
much.
It's incorrect in 2.2/trunk because if {{Server.CURRENT_VERSION}} *is* 
supported by the driver, then the {{IllegalArgumentException}} is never thrown, 
so we don't break out of the loop and {{version}} will end up being incremented 
once too many times. How about this alternative:

{code}
    static
    {
        int version = Server.CURRENT_VERSION;
        while(version >= Server.VERSION_1)
        {
            try
            {
                ProtocolVersion.fromInt(version);
                break;
            }
            catch (IllegalArgumentException e)
            {
                version--;
            }
        }
        maxProtocolVersion = version;
        //TODO java-driver as of C* 2.2rc1 has incomplete V4 implementation - 
so skip V4 for now
        maxProtocolVersion = Math.min(Server.VERSION_3, version);
{code}

We could either remove the last assignment when driver v4 support is complete, 
or just initialise {{version}} to {{VERSION_3}}. I slightly favour the way it's 
done above as it's more explicit.

> smallint, tinyint, date + time types in UDFs
> --------------------------------------------
>
>                 Key: CASSANDRA-9400
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9400
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>             Fix For: 2.2.0 rc1
>
>         Attachments: 9400.txt
>
>
> Cassandra 2.2 adds new types {{smallint}}, {{tinyint, {{date}} + {{time}}.
> However the bundled Java driver does not support them.
> There are two options:
> # Do not allow the new types {{smallint}}, {{tinyint}}, {{date}} + {{time}} 
> for UDFs
> # Use a new Java Driver version that can handle these types.
> Probably we should go with option 1 and update the driver in a 2.2.x release?



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

Reply via email to