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 have to use the mapToDoubleoperator to convert Long into a Double and then use the toList collector.

```
List<Long> longs = new ArrayList<>();
    longs.add(2316354L);
    longs.add(2456354L);
    longs.add(888354L);

    List<Double> doubles = longs.stream().mapToDouble(e->e).boxed().collect(Collectors.toList());

```