Im using cascading/maple as a hbase tap for hbase 0.92.1. I have not been able to query by specifying the row-id. Here is my code -
(ns cascatrial.dbhbase
(:require (cascalog [workflow :as w]
[ops :as c]
[vars :as v]))
(:import (org.apache.hadoop.hbase.util Bytes)
(com.twitter.maple.hbase HBaseTap HBaseScheme)))
(use '[cascalog api playground])
(defn hbase-tap [table-name key-field column-family & value-fields]
(let [scheme (HBaseScheme. (w/fields key-field) column-family (w/fields value-fields))
tap (HBaseTap. table-name scheme)]
tap))
(defn to-string [bytes]
(if (= nil bytes)
""
(String. bytes)))
(defn trial-query
[]
(let [h-table (hbase-tap "test" "row1" "cf" "name" "")]
(?<- (stdout)
[!l !l1 !l2]
(h-table !name !temp !temp2)
(to-string !name :> !l)
(to-string !temp :> !l1)
(to-string !temp2 :> !l2))))
This returns -
RESULTS
-----------------------
row1 pranav
row2
row3
-----------------------
Isnt this query supposed to return only row1? Not sure if im using it incorrectly or if there is a bug in the tap. Some help?
Thanks!