linearregression / hypertable

Automatically exported from code.google.com/p/hypertable
GNU General Public License v2.0
0 stars 0 forks source link

How to insert data into output table (multi column) #742

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
How to insert multiple values in hypertable using hadoop python streaming? i 
can able to insert values for single column, but not more than one column. 
Following exception i get while i'm trying

java.lang.RuntimeException: java.io.IOException: Unable to write cell - 
java.lang.Exception: incorrect output line format only 1 tabs

input from hypertable will be tab separated values, ex : "this is text"

output table contains three columns, i need to split the input text by tab and 
save it into hypertabel. hypertable output column names are "cc" "kw" "oc"

And my map.py and reduce .py are following

***map.py***
import sys
for line in sys.stdin:
    print line

***reduce.py***
import sys

for line in sys.stdin:
        txt= line.split('\t')
        print txt[0]+'\t'+txt[1]+'\t'+txt[2]

Original issue reported on code.google.com by bsenthi...@gmail.com on 9 Dec 2011 at 11:57

GoogleCodeExporter commented 9 years ago

Original comment by nuggetwh...@gmail.com on 14 Jan 2012 at 8:33

GoogleCodeExporter commented 9 years ago
You need to emit three separate lines as follows:

for line in sys.stdin:
        txt= line.split('\t')
        print rowkey+'\t'+"cc"+'\t'+txt[0]
        print rowkey+'\t'+"kw"+'\t'+txt[1]
        print rowkey+'\t'+"oc"+'\t'+txt[2]

Original comment by nuggetwh...@gmail.com on 18 Mar 2012 at 4:54