specifying row-id in cascading/maple

66 views
Skip to first unread message

Pranav

unread,
Jul 10, 2012, 7:15:29 AM7/10/12
to cascal...@googlegroups.com
Hello,

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! 


Nathan Marz

unread,
Jul 11, 2012, 1:00:11 AM7/11/12
to cascal...@googlegroups.com
You may want to ask the cascading list as well, more people there may be familiar with the HBase tap.
--
Twitter: @nathanmarz
http://nathanmarz.com

Message has been deleted

Pranav

unread,
Jul 16, 2012, 1:56:56 AM7/16/12
to cascal...@googlegroups.com
Alternatively, a way to get all columns for a column family using maple would be great too. 

I dont see org.apache.hadoop.hbase.client.Get being used in the source, so Im guessing its not supported, but hoping Im wrong. 

Perhaps Sam could throw some light? 

Thanks! 
Reply all
Reply to author
Forward
0 new messages