datastax

Select in Cassandra with Java (datastax driver) by timestamp

不问归期 提交于 2019-12-24 01:17:20
问题 I am trying to do a SELECT in java into my Cassandra database. I am trying it with: Statement statement = QueryBuilder.select() .all() .from(keySpaceName, tableName) .where((QueryBuilder.eq("asset", categoryPos))) .and(QueryBuilder.gte("date", "2006-06-08 00:00:00")) .limit(10) .allowFiltering() .enableTracing(); The CQL query (already working) is SELECT * FROM pair_tick.price WHERE asset = 1 and date>='2006-06-08 15:30:00' LIMIT 10; When I am trying to execute this query, I get this error:

Cassandra BoundStatement with limit

不想你离开。 提交于 2019-12-23 18:16:48
问题 I am using PreparedStatement and BoundStatement to execute some Cassandra queries. The problem is, I am trying to use a limit on these. This is what I have: selectByDatasetIdAndTimePreparedStatement = getSession().prepare( QueryBuilder.select() .all() .from(KEYSPACE_NAME, TABLE_NAME) .where(QueryBuilder.eq(AFFILIATION_ID_COLUMN, QueryBuilder.bindMarker())) .and(QueryBuilder.eq(DATASET_ID_COLUMN, QueryBuilder.bindMarker())) .and(QueryBuilder.lte(TIME_COLUMN, QueryBuilder.bindMarker())) //

Is Cassandra for OLAP or OLTP or both?

☆樱花仙子☆ 提交于 2019-12-23 17:55:44
问题 Cassandra does not comply with ACID like RDBMS but CAP. So Cassandra picks AP out of CAP and leaves it to the user for tuning consistency. I definitely cannot use Cassandra for core banking transaction because C* is slightly inconsistent. But Cassandra writes are extremely fast which is good for OLTP. I can use C* for OLAP because reads are extremely fast which is good for reporting too. So i understood that C* is good only when your application do not need your data to be consistent for some

Datastax Cassandra - Inheritance when using object mapper

余生颓废 提交于 2019-12-23 15:14:27
问题 I try using Cassandra for persisting quite simple POJOs, but using a class hierarchy (many subclasses, one superclass). I am using Java and the Datastax driver (and the object mapper). My problem is that the Object Mapper doesn't seem to recognize fields annotated in superclasses. The structure I implemented is: @Table(keyspace = "...", name = "...") public class Subclass extends Superclass { public double x; public double y; public double z; .... } public class Superclass { @PartitionKey(0)

Dealing with Cassandra Timestamp

不问归期 提交于 2019-12-23 09:32:35
问题 Recently I have started working on cassandra and I have some issues dealing with cassandra timestamp using cql and Java. Below is my sample cassandra table schema. CREATE TABLE emp ( empid int, create_date timestamp, deptid int, PRIMARY KEY (empid, create_date) ) Here are my questions below: 1) Actually I need only date(I am not worried about time), In my table schema I have used timestamp datatype, Is there any datatype like date to store only date instead timestamp. 2) If there is no

What is role of bloom filter in cassandra?

℡╲_俬逩灬. 提交于 2019-12-23 09:04:51
问题 From two different links of the Cassandra's documentation, I found: link 1 A structure stored in memory that checks if row data exists in the memtable before accessing SSTables on disk and link2 Cassandra checks the Bloom filter to discover which SSTables are likely to have the request partition data. My question is does both the above statements are right? If yes, does bloom filters maintained for a Memtable and SSTable separately? Thanks in advance. 回答1: A Bloom filter is a generic data

DataStax Enterprise 4.8.4 on Ubuntu 14.04 LTS install error when using apt repository installation

别等时光非礼了梦想. 提交于 2019-12-23 05:16:12
问题 I used the apt repository installation approach exactly as outlined at docs.datastax.com/en/datastax_enterprise/install/installDEBdse.html There were no issues with the key. I have Oracle Server JDK 8 (latest as of today). Python 2.7 from Miniconda (also fresh install today), using defaults and allowing for prepending of PATH variables. Following installation, there are errors regarding unmet dependencies: dse-full : Depends: dse (=4.8.4-1) but it is not going to be installed Depends: dse

My Datastax Spark doesn't work with my current python version and I have no idea why?

会有一股神秘感。 提交于 2019-12-23 04:53:28
问题 Below is my error message. When I use python 2.7 in Datastax Spark with the code below it doesn't work. I don't know why. Would be very grateful for some suggestions. Thanks vi /etc/dse/spark/spark-env.sh export PYTHONHOME=/usr/local export PYTHONPATH=/usr/local/lib/python2.7 export PYSPARK_PYTHON=/usr/local/bin/python2.7 Error message: Error from python worker: /usr/local/bin/python2.7: /usr/local/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyCodec_LookupTextEncoding PYTHONPATH was:

Datastax cassandra driver giving wrong metadata information about host states

感情迁移 提交于 2019-12-23 02:48:07
问题 I got a cluster with 2 DCs and each DC contain 2 nodes. DC1: 192.168.60.81 192.168.60.82 DC2: 192.168.60.242 192.168.60.247 Application is connected to 192.168.60.81 and hence the local DC for the application is DC1. Situation 1: Initially when all the nodes are up and when I try to get cluster.metadata.allHosts , it gives me information about the state of the host as UP. Situation 2: When any of the nodes in local datacenter (DC1) goes up or down, the cluster.metadata.allHosts gives me the

Two node DSE spark cluster error setting up second node. Why?

巧了我就是萌 提交于 2019-12-23 01:52:27
问题 I have DSE spark cluster with 2 nodes. One DSE analytics node with spark cannot start after I install it. Without spark it starts just fine. But on my other node spark is enabled and it can start and works just fine. Why is that and how can I solve that? Thanks. Here is my error log: ERROR [main] 2016-02-27 20:35:43,353 CassandraDaemon.java:294 - Fatal exception during initialization org.apache.cassandra.exceptions.ConfigurationException: Cannot start node if snitch's data center (Analytics)