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();

```
Try something in the line of:

```
List<Double> doubles = list.stream()
         .map(e -> Double.valueOf(e))
         .collect(Collectors.toList());

```

Explanation

```
list.stream().

```

This makes you create (and iterate over) a stream.

```
map(e -> Double.valueOf(e))

```

each (Long) element you iterate over, will be mapped to a Double

```
.collect(Collectors.toList());

```

This maps it to a `List<Double>`.