Question: is there a way to fetch last three year data from the hive table
my column has a data in this format (2018-07-01 00:00:00.0)
I have to fetch out last three years data

Answer: 
You have to use the `map` operator to convert `Long` into a `Double` and then use the `toList` collector.

```
List<Double> doubleValues = list.stream()
    .map(Double::valueOf)
    .collect(Collectors.toList());

```

Conversely, if you are concerned about the overhead of autoboxing, you can create an array of `double`. Here's how it looks.

```
double[] doubleArr = list.stream().mapToDouble(v -> v).toArray();

```
You can do this without boxing `long` and `double` values using [Eclipse Collections](https://github.com/eclipse/eclipse-collections):

```
LongList longs = LongLists.mutable.with(4L, 92L, 100L);
DoubleList doubles = longs.collectDouble(l -> l, DoubleLists.mutable.empty());

Assert.assertEquals(DoubleLists.mutable.with(4.0, 92.0, 100.0), doubles);

```

You can also do this with Java Streams and Eclipse Collections converting from a `List<Long>` to a `DoubleList`:

```
List<Long> list = Arrays.asList(4L, 92L, 100L);
DoubleList doubles = DoubleLists.mutable.withAll(
        list.stream().mapToDouble(Long::doubleValue));

Assert.assertEquals(DoubleLists.mutable.with(4.0, 92.0, 100.0), doubles);

```

Note: I am a committer for Eclipse Collections