def list_rows(dataset_name, table_name, project=None):
 bigquery_client = bigquery.Client(project=project)
 dataset = bigquery_client.dataset(dataset_name)
 table = dataset.table(table_name)
 if (not table.exists()):
  print 'Table {}:{} does not exist.'.format(dataset_name, table_name)
  return
 table.reload()
 rows = list(table.fetch_data(max_results=25))
 format_string = ('{!s:<16} ' * len(table.schema))
 field_names = [field.name for field in table.schema]
 print format_string.format(*field_names)
 for row in rows:
  print format_string.format(*row)

def list_rows ( dataset_name , table_name , project = None ) : bigquery_client = bigquery . Client ( project = project ) dataset = bigquery_client . dataset ( dataset_name ) table = dataset . table ( table_name ) if ( not table . exists ( ) ) : print 'Table {}:{} does not exist.' . format ( dataset_name , table_name ) return table . reload ( ) rows = list ( table . fetch_data ( max_results = 25 ) ) format_string = ( '{!s:<16} ' * len ( table . schema ) ) field_names = [ field . name for field in table . schema ] print format_string . format ( * field_names ) for row in rows : print format_string . format ( * row )
prints rows in the given table .