riak-ts


getting latest inserted object from riak timeseries


Procedure to get latest record from Riak TS based on timestamp.
I created following table:
CREATE TABLE devicedetail (memberId SINT64 NOT NULL, type VARCHAR NOT NULL,model VARCHAR NOT NULL,imei VARCHAR NOT NULL,deviceId VARCHAR NOT NULL,manufacturer VARCHAR NOT NULL,os VARCHAR NOT NULL,version VARCHAR NOT NULL,time TIMESTAMP NOT NULL,PRIMARY KEY ((memberId),memberId));
Insert data using SQL:
INSERT INTO devicedetail VALUES (110,'health Kit','andorid-4.0','76565657675222','sdgsd1212','sony','windows','5.0',1420113600000);
and now I want to select deviceId based on latest inserted record:
select deviceId from devicedetail where memberId=110 and type='health Kit' order by time desc limit 1;
I am getting Exception like:
SQL Parser error {<<"order">>,riak_ql_parser,
["syntax error before: ","identifier"]}
but while querying:
select deviceId from devicedetail where memberId=110 and type='health Kit';
Getting Output as:
+---------+
|deviceId |
+---------+
|sdgsd1212|
+---------+
Anyone knows how we get this in a simple way? Please tell me.
Answer as of December 21, 2016:
Riak TS 1.5 was released this week. ORDER BY and LIMIT are now supported.
Old Answer:
ORDER BY is not supported in the current version of Riak TS (1.4) which is why you are getting the error. LIMIT is also not yet supported. ORDER BY and LIMIT will be included in the near future.

Related Links

Riak TS Delete Query for record
riak-shell giving error as Not connected to riak
how we define auto increment id in riak ts
getting latest inserted object from riak timeseries

Categories

HOME
python
google-apps-script
jsf
cluster-computing
filterrific
bing
wxwidgets
parse-server
ruby-on-rails-3
bibtex
zend-framework2
sbt-assembly
rocketmq
ext.net
packer
flexbox
getorgchart
pjsip
ndis
camera-calibration
uiscrollview
informatica-powercenter
event-log
r-lavaan
yeoman-generator
derived
chocolatey
statusbar
embedly
epicor
header-files
myob
fetch-api
edge-detection
chrome-native-messaging
cgal
partial-application
pitest
modelandview
qtablewidget
rhel.net
codesys
s3cmd
tic-tac-toe
cross-entropy
android-preferences
flex4.5
rule
distributed-transactions
html-agility-pack
stress-testing
catia
php-ews
livefyre
maintenance
decompress
gce
heroku-postgres
jszip
settimeout
c64
wcf-ria-services
multilingual-app-toolkit
fps
aerogear
git-rebase
web-essentials
cctray
matcaffe
p-np
futuretask
type-mismatch
mdm-zinc
viewflipper
named-ranges
snmp4j
ghostdoc
author
dbsetup
roxygen
visual-studio-addins
gfs
cdata
nscolor
client-library
web-safe-fonts
moq-3
visual-web-gui
rijndael
delegatecommand
filetime
hmacsha1
gears

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App