spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deep Pradhan <pradhandeep1...@gmail.com>
Subject Number of elements in ArrayBuffer
Date Wed, 03 Sep 2014 04:43:05 GMT
Hi,
I have the following ArrayBuffer:

*ArrayBuffer(5,3,1,4)*

Now, I want to get the number of elements in this ArrayBuffer and also the
first element of the ArrayBuffer. I used .length and .size but they are
returning 1 instead of 4.
I also used .head and .last for getting the first and the last element but
they also return the entire ArrayBuffer (ArrayBuffer(5,3,1,4))
What I understand from this is that, the entire ArrayBuffer is stored as
one element.

How should I go about doing the required things?

Thank You

Mime
View raw message