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

```
```
List<Double> collect1 = list.stream()
          .mapToDouble(s -> s) // DoubleStream
          .boxed()  // Stream<Double>
          .collect(Collectors.toList());  //collected to List<Double>

```

caution: `boxing()` is overhead.

---

Another way around, without `boxing()`

```
List<Double> listDouble = new ArrayList<>();
list.stream().mapToDouble(s->s).forEach(k->listDouble.add(k));

```