You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by liu jay <ja...@gmail.com> on 2013/11/22 13:09:44 UTC

import proto buffer file in a python transform script error(Very urgent)!

Hi Dear!

      i user transform of hive to Analysis logs,and than, some fields of
logs is pb type, i done is follow:

  1)  HIVESQL is :
        add file hive_shift_parse.py
          add file  locationShift_pb2.py
         select transform(log) using 'python hive_shift_parse.py' as
sm_datetime,sm_appid,sm_language,sm_iosMaxVersion,sm_iosMinVersion,sm_messageid,sm_logtype,sm_request,sm_response,sm_status,sm_responsetime,sm_ip,sm_province,sm_city,sm_town,sm_day_time
from snowman_service_raw;

 2)  import of hive_shift_parse.py  is follow:
    import urllib2,sys,os,re,datetime,json,time,math
import fileinput
import base64
import locationShift_pb2
3)  locationShift_pb2.py is a pb file。
4)run error is follow:
     Traceback (most recent call last):

  File " hive_shift_parse.py.py", line 6, in ?

    import locationShift_pb2
ImportError: No module named locationShift_pb2

i search result in google,but can not Solve。i guest the problem is
load of proto buffer(pb).

    thanks for help.