Я нашел решение для подсчета элементов в pcollection с помощью Count.Globally (). Функция относится к классу apache_beam.transforms.combiners.
counts = self.all_dim_joined_pcol | Count.Globally()
def collect(row):
temp_list.append(row)
print ("Count value is :" , temp_list)
message = "Join done successfully between {} and {} having count as {}".format(tbl1,tbl2,temp_list)
counts | "printing record count for" + fact_table_name + dimension_table_name >> beam.Map(collect)