Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Feature/distcache #64

Merged
merged 4 commits into from
Jul 1, 2014
Merged

Feature/distcache #64

merged 4 commits into from
Jul 1, 2014

Conversation

myui
Copy link
Owner

@myui myui commented Jul 1, 2014

distcache_gets() retrieves key/value data in a SequenceFile format (a hive table) from the distributed cache.

Usage

distcache_gets(const string FILEPATH, object[] keys, const object defaultValue)::map<key_type, value_type>

distcache_gets(const string FILEPATH, object key, const object defaultValue)::value_type

Example

hive> desc lr_model;
> feature                 int
> weight                  float
-- Copy key/value table on HDFS to the distributed cache
add file hdfs://dm01:8020/user/hive/warehouse/kdd12track2.db/lr_model;

-- returns multiple values for each feature
create table test01 as
select 
  rowid, 
  distcache_gets('lr_model', features, cast(0 as float)) as weights
from 
  testing2;
hive> desc test01; 
> rowid                   bigint 
> weights                 map<int,float> 
-- returns single value for a feature
select 
  rowid, 
  distcache_gets('lr_model', features[0], cast(0 as float)) as weight
from 
  testing2
limit 100;

myui added a commit that referenced this pull request Jul 1, 2014
@myui myui merged commit 4647931 into master Jul 1, 2014
@myui myui deleted the feature/distcache branch July 1, 2014 22:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant