#NEWLINE# def RDFValueToBigQuerySchema( self , value ) : #NEWLINE# #INDENT# 'Convert Exported* rdfvalue into a BigQuery schema.' #NEWLINE# fields_array = [ ] #NEWLINE# for type_info in value . __class__ . type_infos : #NEWLINE# #INDENT# if ( type_info . __class__ . __name__ == 'ProtoEmbedded' ) : #NEWLINE# #INDENT# fields_array . append ( { #NEWLINE# #INDENT# 'name' : type_info . name , #NEWLINE# 'type' : 'RECORD' , #NEWLINE# 'description' : type_info . description , #NEWLINE# 'fields' : self . RDFValueToBigQuerySchema ( value . Get ( type_info . name ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bq_type = ( self . RDF_BIGQUERY_TYPE_MAP . get ( type_info . proto_type_name , None ) or 'STRING' ) #NEWLINE# if hasattr ( type_info , 'original_proto_type_name' ) : #NEWLINE# #INDENT# if ( type_info . original_proto_type_name in [ 'RDFDatetime' , 'RDFDatetimeSeconds' ] ) : #NEWLINE# #INDENT# bq_type = 'TIMESTAMP' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type_info . proto_type_name == 'uint64' ) : #NEWLINE# #INDENT# bq_type = 'STRING' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# fields_array . append ( { #NEWLINE# #INDENT# 'name' : type_info . name , #NEWLINE# 'type' : type_info , #NEWLINE# 'description' : type_info . description , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return fields_array