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: 
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>`.
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());

```