parameters: (file_name, rows, types, row_group_size)
docstring: Create two parquets with columns we support.
docstring_summary: Create two parquets with columns we support.
docstring_tokens: Create two parquets with columns we support .
function: def write_parquet(file_name, rows, types, row_group_size):
      '''Create two parquets with columns we support.'''
      # pivot to be column major, create arrow structures
      fields = []
      for i in range(len(types)):
          col = []
          col.append([row[i] for row in rows])
          fields.append(pa.chunked_array(col, type=types[i]))
  
      cols = [pa.Column.from_array(name_of(types[i], i), fields[i]) for i in range(len(fields))]
      table = pa.Table.from_arrays(cols)
      print('Writing {}'.format(file_name))
      pq.write_table(table,
                     file_name,
                     row_group_size=row_group_size,
                     use_deprecated_int96_timestamps=True)
function_tokens: def write_parquet ( file_name , rows , types , row_group_size ) : # pivot to be column major, create arrow structures fields = [ ] for i in range ( len ( types ) ) : col = [ ] col . append ( [ row [ i ] for row in rows ] ) fields . append ( pa . chunked_array ( col , type = types [ i ] ) ) cols = [ pa . Column . from_array ( name_of ( types [ i ] , i ) , fields [ i ] ) for i in range ( len ( fields ) ) ] table = pa . Table . from_arrays ( cols ) print ( 'Writing {}' . format ( file_name ) ) pq . write_table ( table , file_name , row_group_size = row_group_size , use_deprecated_int96_timestamps = True )