How to get the lists' length in one column in dataframe spark? : <p>I have a df whose 'products' column are lists like below:</p>

<pre><code>+----------+---------+--------------------+
|member_srl|click_day|            products|
+----------+---------+--------------------+
|        12| 20161223|  [2407, 5400021771]|
|        12| 20161226|        [7320, 2407]|
|        12| 20170104|              [2407]|
|        12| 20170106|              [2407]|
|        27| 20170104|        [2405, 2407]|
|        28| 20161212|              [2407]|
|        28| 20161213|      [2407, 100093]|
|        28| 20161215|           [1956119]|
|        28| 20161219|      [2407, 100093]|
|        28| 20161229|           [7905970]|
|       124| 20161011|        [5400021771]|
|      6963| 20160101|         [103825645]|
|      6963| 20160104|[3000014912, 6626...|
|      6963| 20160111|[99643224, 106032...|
</code></pre>

<p>How to add a new column <code>product_cnt</code> which are the length of <code>products</code> list? And how to filter df to get specified rows with condition of given products length ? 
Thanks.</p>
