title: Count unique values in a row
body: <p>The test data:</p>
  <pre><code>df = spark.createDataFrame([(1, 1), (2, 3), (3, 3)], ['c1', 'c2'])
  df.show()
  #+---+---+
  #| c1| c2|
  #+---+---+
  #|  1|  1|
  #|  2|  3|
  #|  3|  3|
  #+---+---+
  </code></pre>
  <p>I intend to count distinct values in every <strong>row</strong>, creating a separate column with the count. How to do it?</p>
  <p>The desired result:</p>
  <pre><code>#+---+---+---+
  #| c1| c2| c3|
  #+---+---+---+
  #|  1|  1|  1|
  #|  2|  3|  2|
  #|  3|  3|  1|
  #+---+---+---+
  </code></pre>