when flag == 0, write into avro directly