HivePartitionSensosr
Adding max_partition macro, fixing bugs