Question: I want to find all possible maximum contiguous subarray averages from an array of values. Each array value represents the value at a duration, the number of seconds passed.

Ex. Input = [6, 4, 3, 10, 5]

Ex. Output = [5.6, 5.75, 6, 7.5, 10]

Output[0] = 6+4+3+10+5 / 5 = 5.6

Output[1] = 6+4+3+10 / 4 = 5.75

Output[2] = 3+10+5 / 3 = 6

Output[3] = 10+5 / 2 = 7.5

Output[4] = 10 / 1 = 10

The issue is that the real data has length of up to 40,000 values. 

The result should have the same length as the input. I‘ve done a reduce on a subarray of specific lengths (only getting 5s, 60s, 3600s, etc. length), but that’s not a viable solution for each possible duration. Is there a way I can partition or otherwise create a specialized data structure to get these values? If not, how can I exclude durations as I go?

Answer: 
I was also getting the same error for Oozie 5.2.0 . It was very frustrating.

So, here it says having 2 incompatible versions of Guava causes this error: <https://issues.apache.org/jira/browse/HIVE-22915>

This is what worked for me:

I checked the jars in libext folder first.There was only guava-27.0-jre.jar file.

```
cd /usr/local/oozie/oozie-5.2.0/libext
ls

```

Then I checked oozie lib folder and there were 2 Guava files;
guava-11.0.2.jar and guava-27.0-jre.jar

```
cd /usr/local/oozie/oozie-5.2.0/lib
ls

```

Removing guava-11.0.2.jar solved the problem:

```
rm guava-11.0.2.jar

```

Note: When you run `oozied.sh run` if you get the following exception:

```
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism(Ljava/lang/String;)V
    at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:84)
    at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:319)
    at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:365)
...

```

Then check to see if you have two `hadoop-auth` jar's in your `oozie-5.2.0/lib` directory. I had similarly had two: `hadoop-auth-2.6.0.jar` and `hadoop-auth-3.2.4.jar`. Removing the 2.6.0 jar fixed this issue for me as well.

```
rm hadoop-auth-2.6.0.jar

```
Because `Log4j2` and `Log4j` conflict，Delete all `log4j2` packages in oozie/lib.

example:

`log4j-1.2-api-2.6.2.jar log4j-api-2.6.2.jar log4j-core-2.6.2.jar log4j-slf4j-impl-2.6.2.jar log4j-web-2.6.2.jar`