parameters: (self, ptype)
docstring: 内部接口
docstring_summary: 内部接口
docstring_tokens: 内部接口
function: def transform_to_node(self, ptype):
          """
          内部接口
          """
          from bigflow import schema
          if (self.fields is not None) and (not schema._is_tuple_serde(ptype.serde())):
              if isinstance(self.fields, int):
                  return super(SchemaTextFile, self).transform_to_node(
                      ptype.map(lambda tp: self.sep.join(tuple(str(field) for field in tp))))
              elif schema._is_fieldsdict_serde(ptype.serde()):
                  return super(SchemaTextFile, self).transform_to_node(
                      ptype.apply(schema.dict_to_tuple, self.fields)
                      .map(lambda tp: self.sep.join(tuple(str(field) for field in tp))))
              else:
                  # non schema pcollection with fields
                  return super(SchemaTextFile, self).transform_to_node(
                      ptype.map(lambda d: (self.sep.join(str(d.get(f)) for f in self.fields))))
          elif schema._is_tuple_serde(ptype.serde()):
              return super(SchemaTextFile, self).transform_to_node(
                  ptype.map(lambda tp: self.sep.join(tuple(str(field) for field in tp))))
          else:
              raise ValueError("若SchemaPCollection的元素是dict, 必须指定columns(list)表示输出的字段名")
function_tokens: def transform_to_node ( self , ptype ) : from bigflow import schema if ( self . fields is not None ) and ( not schema . _is_tuple_serde ( ptype . serde ( ) ) ) : if isinstance ( self . fields , int ) : return super ( SchemaTextFile , self ) . transform_to_node ( ptype . map ( lambda tp : self . sep . join ( tuple ( str ( field ) for field in tp ) ) ) ) elif schema . _is_fieldsdict_serde ( ptype . serde ( ) ) : return super ( SchemaTextFile , self ) . transform_to_node ( ptype . apply ( schema . dict_to_tuple , self . fields ) . map ( lambda tp : self . sep . join ( tuple ( str ( field ) for field in tp ) ) ) ) else : # non schema pcollection with fields return super ( SchemaTextFile , self ) . transform_to_node ( ptype . map ( lambda d : ( self . sep . join ( str ( d . get ( f ) ) for f in self . fields ) ) ) ) elif schema . _is_tuple_serde ( ptype . serde ( ) ) : return super ( SchemaTextFile , self ) . transform_to_node ( ptype . map ( lambda tp : self . sep . join ( tuple ( str ( field ) for field in tp ) ) ) ) else : raise ValueError ( "若SchemaPCollection的元素是dict, 必须指定columns(list)表示输出的字段名")