The first case (all columns referenced in the partitioning expression are part of UPI) is allowed. Teradata can enforce the uniqueness constraint efficiently. It only needs to check other rows in the same partition having the same row hash.
The other case is not allowed. You will get an error condition on your CREATE TABLE if you attempt it.