refactor sparkhivehadoopwriter