title: Hive - how to perform operation on state change
body: <p>I have two columns in my hive table. col2 contains values 'Y' and 'N'. In hive I would like to loop through the table and if every time there is a state change(from N to Y or from Y to N), I would like to insert a new row in another table. How do I do that using hiveql? Thanks guys!</p>