cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Finke <Andreas.Fi...@solvians.com>
Subject RE: Problems with user defined types (cql) and Datastax Java Driver
Date Thu, 05 Feb 2015 23:43:35 GMT
Hi Alex,

I did so. Thanks for that hint.

Andi
________________________________
From: Alex Popescu [alexp@datastax.com]
Sent: 05 February 2015 18:14
To: user
Subject: Re: Problems with user defined types (cql) and Datastax Java Driver

Andreas,

Can you please post your question to the Java driver ml https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
as you'll have better chances to get an answer there.

thanks

On Thu, Feb 5, 2015 at 9:10 AM, Andreas Finke <Andreas.Finke@solvians.com<mailto:Andreas.Finke@solvians.com>>
wrote:
Hi,

I encountered the problem that in Java the Session does not create a valid UserType for my
corresponding CQL user defined type.

CQL_SCHEMA:

create keyspace if not exists quotes
WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

CREATE TYPE IF NOT EXISTS quotes.price (
                value double,
                size bigint,
                timestamp bigint,
                delay int
);

JAVA

UserType priceType = session.getCluster().getMetadata().getKeyspace("quotes").getUserType("price");
Assert.assertNotNull(priceType); // true
Assert.assertEquals("price", priceType.getTypeName()); // true
Assert.assertEquals(4, priceType.getFieldNames().size()); // AssertionFailedError: expected:<4>
but was:<0>

I am testing with Cassandra v.2.1.2 on Windows using Datastax Java Driver 2.1.2.

I am thankful for any suggestions.

Regards
Andi



--

[:>-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru

Mime
View raw message