I have a dataframe in Spark with below data
{ID:"1",CNT:"2", Age:"21", Class:"3"}
{ID:"2",CNT:"3", Age:"24", Class:"5"}
I want to iterate over the Data frame based on the CNT value and generate output like below :
{ID:"1",CNT:"1", Age:"21", Class:"3"}
{ID:"1",CNT:"2", Age:"21", Class:"3"}
{ID:"2",CNT:"1", Age:"24", Class:"5"}
{ID:"2",CNT:"2", Age:"24", Class:"5"}
{ID:"2",CNT:"3", Age:"24", Class:"5"}
Can some one have any idea how to achieve this.