Merge branch 'gerrit/mad-hatter'
Change-Id: Ie6c8e1f55ae3f1a8efec8f207813811d9ac09a2c
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutor.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutor.java
index 09b8c1e..c0cf8eb 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutor.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutor.java
@@ -190,6 +190,8 @@
}
class Profile implements Serializable {
+ private static final long serialVersionUID = 4813321148252768375L;
+
private transient ObjectNode profile;
public Profile(ObjectNode profile) {
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
index 6ec74cf..82dc344 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
@@ -1239,8 +1239,16 @@
} else if (BuiltinFunctions.NTH_VALUE_IMPL.equals(fi)) {
nestedAggFunc = BuiltinFunctions.SCALAR_FIRST_ELEMENT;
if (fromLast) {
- // reverse order if FROM LAST modifier is present
+ // if FROM LAST modifier is present
+ // 1. reverse order
reverseOrder(orderExprListOut);
+ // 2. reverse frame specification
+ WindowExpression.FrameBoundaryKind tmpFrameStartKind = winFrameStartKind;
+ Expression tmpFrameStartExpr = winFrameStartExpr;
+ winFrameStartKind = reverseFrameBoundaryKind(winFrameEndKind);
+ winFrameStartExpr = winFrameEndExpr;
+ winFrameEndKind = reverseFrameBoundaryKind(tmpFrameStartKind);
+ winFrameEndExpr = tmpFrameStartExpr;
}
if (respectNulls) {
winFrameMaxOjbects = 1;
@@ -1737,4 +1745,22 @@
throw new CompilationException(ErrorCode.COMPILATION_ERROR);
}
}
+
+ private WindowExpression.FrameBoundaryKind reverseFrameBoundaryKind(
+ WindowExpression.FrameBoundaryKind frameBoundaryKind) throws CompilationException {
+ switch (frameBoundaryKind) {
+ case UNBOUNDED_PRECEDING:
+ return WindowExpression.FrameBoundaryKind.UNBOUNDED_FOLLOWING;
+ case BOUNDED_PRECEDING:
+ return WindowExpression.FrameBoundaryKind.BOUNDED_FOLLOWING;
+ case CURRENT_ROW:
+ return WindowExpression.FrameBoundaryKind.CURRENT_ROW;
+ case BOUNDED_FOLLOWING:
+ return WindowExpression.FrameBoundaryKind.BOUNDED_PRECEDING;
+ case UNBOUNDED_FOLLOWING:
+ return WindowExpression.FrameBoundaryKind.UNBOUNDED_PRECEDING;
+ default:
+ throw new CompilationException(ErrorCode.COMPILATION_ERROR);
+ }
+ }
}
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/ResultMetadata.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/ResultMetadata.java
index e5ed091..35e8daf 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/ResultMetadata.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/ResultMetadata.java
@@ -27,6 +27,7 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
public class ResultMetadata implements IResultMetadata {
+ private static final long serialVersionUID = 1905367559307369034L;
private final SessionConfig.OutputFormat format;
private long jobDuration;
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/ProfilePrinter.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/ProfilePrinter.java
index d74d25c..bb835ff 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/ProfilePrinter.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/ProfilePrinter.java
@@ -49,6 +49,7 @@
pw.print("\t\"" + FIELD_NAME + "\" : ");
ObjectMapper om = new ObjectMapper();
om.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
+ @SuppressWarnings("serial")
DefaultIndenter ind = new DefaultIndenter("\t", DefaultIndenter.SYS_LF) {
@Override
public void writeIndentation(JsonGenerator jg, int level) throws IOException {
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.1.ddl.sqlpp
new file mode 100644
index 0000000..bafc59a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.1.ddl.sqlpp
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * Description : Test that temporary run files generated are deleted as soon as possible and query runs fine
+ * Expected Result : Success
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type openType as open {id: uuid};
+create dataset ds1(openType) primary key id autogenerated;
+create dataset ds2(openType) primary key id autogenerated;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.2.update.sqlpp
new file mode 100644
index 0000000..9a695ff
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.2.update.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+insert into ds1(from range(0,1000000) as data select value {"f1": 1});
+insert into ds2(from range(0,1000000) as data select value {"f1": 2});
+
+insert into ds1 {"f1": 3};
+insert into ds2 {"f1": 3};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.3.query.sqlpp
new file mode 100644
index 0000000..f668266
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+set `compiler.joinmemory` "180KB";
+
+from ds1 join ds2 on ds1.f1 = ds2.f1
+select ds1.f1;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.4.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.4.ddl.sqlpp
new file mode 100644
index 0000000..548e632
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.4.ddl.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+drop dataverse test if exists;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.6.query.sqlpp
new file mode 100644
index 0000000..4656f74
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.6.query.sqlpp
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description : NTH_VALUE() FROM LAST, from unbounded preceding
+ * Expected Res : SUCCESS
+ */
+
+from [
+ { "x": "a", "y": 1, "p": 0 },
+ { "y": 2, "p": 0 },
+ { "x": null, "y": 3, "p": 0 },
+ { "x": "b", "y": 4, "p": 0 },
+ { "x": "c", "y": 5, "p": 0 },
+
+ { "x": "a", "y": 6, "p": 1 },
+ { "x": null, "y": 7, "p": 1 },
+ { "y": 8, "p": 1 },
+ { "x": "b", "y": 9, "p": 1 },
+ { "x": "c", "y": 10, "p": 1 }
+] t
+select
+ //
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between unbounded preceding and 1 preceding)
+ as n_up_1p_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between unbounded preceding and 1 preceding)
+ as n_up_1p_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between unbounded preceding and current row)
+ as n_up_cr_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between unbounded preceding and current row)
+ as n_up_cr_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between unbounded preceding and 1 following)
+ as n_up_1f_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between unbounded preceding and 1 following)
+ as n_up_1f_i,
+ x, y, p
+order by y
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.7.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.7.query.sqlpp
new file mode 100644
index 0000000..f03711e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.7.query.sqlpp
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description : NTH_VALUE() FROM LAST, from bounded preceding
+ * Expected Res : SUCCESS
+ */
+
+from [
+ { "x": "a", "y": 1, "p": 0 },
+ { "y": 2, "p": 0 },
+ { "x": null, "y": 3, "p": 0 },
+ { "x": "b", "y": 4, "p": 0 },
+ { "x": "c", "y": 5, "p": 0 },
+
+ { "x": "a", "y": 6, "p": 1 },
+ { "x": null, "y": 7, "p": 1 },
+ { "y": 8, "p": 1 },
+ { "x": "b", "y": 9, "p": 1 },
+ { "x": "c", "y": 10, "p": 1 }
+] t
+select
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between 3 preceding and 1 preceding)
+ as n_3p_1p_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between 3 preceding and 1 preceding)
+ as n_3p_1p_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between 3 preceding and current row)
+ as n_3p_cr_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between 3 preceding and current row)
+ as n_3p_cr_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between 3 preceding and 1 following)
+ as n_3p_1f_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between 3 preceding and 1 following)
+ as n_3p_1f_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between 3 preceding and unbounded following)
+ as n_3p_uf_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between 3 preceding and unbounded following)
+ as n_3p_uf_i,
+ x, y, p
+order by y
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.8.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.8.query.sqlpp
new file mode 100644
index 0000000..ec553e5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.8.query.sqlpp
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description : NTH_VALUE() FROM LAST, from current row
+ * Expected Res : SUCCESS
+ */
+
+from [
+ { "x": "a", "y": 1, "p": 0 },
+ { "y": 2, "p": 0 },
+ { "x": null, "y": 3, "p": 0 },
+ { "x": "b", "y": 4, "p": 0 },
+ { "x": "c", "y": 5, "p": 0 },
+
+ { "x": "a", "y": 6, "p": 1 },
+ { "x": null, "y": 7, "p": 1 },
+ { "y": 8, "p": 1 },
+ { "x": "b", "y": 9, "p": 1 },
+ { "x": "c", "y": 10, "p": 1 }
+] t
+select
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between current row and 3 following)
+ as n_cr_3f_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between current row and 3 following)
+ as n_cr_3f_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between current row and unbounded following)
+ as n_cr_uf_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between current row and unbounded following)
+ as n_cr_uf_i,
+ x, y, p
+order by y
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.9.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.9.query.sqlpp
new file mode 100644
index 0000000..be7adca
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/nth_value_01/nth_value_01.9.query.sqlpp
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description : NTH_VALUE() FROM LAST, from bounded following
+ * Expected Res : SUCCESS
+ */
+
+from [
+ { "x": "a", "y": 1, "p": 0 },
+ { "y": 2, "p": 0 },
+ { "x": null, "y": 3, "p": 0 },
+ { "x": "b", "y": 4, "p": 0 },
+ { "x": "c", "y": 5, "p": 0 },
+
+ { "x": "a", "y": 6, "p": 1 },
+ { "x": null, "y": 7, "p": 1 },
+ { "y": 8, "p": 1 },
+ { "x": "b", "y": 9, "p": 1 },
+ { "x": "c", "y": 10, "p": 1 }
+] t
+select
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between 1 following and 3 following)
+ as n_1f_3f_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between 1 following and 3 following)
+ as n_1f_3f_i,
+ nth_value(x, 2) from last respect nulls over (partition by p order by y range between 1 following and unbounded following)
+ as n_1f_uf_r,
+ nth_value(x, 2) from last ignore nulls over (partition by p order by y range between 1 following and unbounded following)
+ as n_1f_uf_i,
+ x, y, p
+order by y
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.1.adm
new file mode 100644
index 0000000..fca24df
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/join-ASTERIXDB-2686/join-ASTERIXDB-2686.1.adm
@@ -0,0 +1 @@
+{ "f1": 3 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.6.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.6.adm
new file mode 100644
index 0000000..0d6ae8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.6.adm
@@ -0,0 +1,10 @@
+{ "n_up_1p_r": null, "n_up_1p_i": null, "n_up_cr_r": null, "n_up_cr_i": null, "n_up_1f_r": "a", "n_up_1f_i": null, "x": "a", "y": 1, "p": 0 }
+{ "n_up_1p_r": null, "n_up_1p_i": null, "n_up_cr_r": "a", "n_up_cr_i": null, "n_up_1f_i": null, "y": 2, "p": 0 }
+{ "n_up_1p_r": "a", "n_up_1p_i": null, "n_up_cr_i": null, "n_up_1f_r": null, "n_up_1f_i": "a", "x": null, "y": 3, "p": 0 }
+{ "n_up_1p_i": null, "n_up_cr_r": null, "n_up_cr_i": "a", "n_up_1f_r": "b", "n_up_1f_i": "b", "x": "b", "y": 4, "p": 0 }
+{ "n_up_1p_r": null, "n_up_1p_i": "a", "n_up_cr_r": "b", "n_up_cr_i": "b", "n_up_1f_r": "b", "n_up_1f_i": "b", "x": "c", "y": 5, "p": 0 }
+{ "n_up_1p_r": null, "n_up_1p_i": null, "n_up_cr_r": null, "n_up_cr_i": null, "n_up_1f_r": "a", "n_up_1f_i": null, "x": "a", "y": 6, "p": 1 }
+{ "n_up_1p_r": null, "n_up_1p_i": null, "n_up_cr_r": "a", "n_up_cr_i": null, "n_up_1f_r": null, "n_up_1f_i": null, "x": null, "y": 7, "p": 1 }
+{ "n_up_1p_r": "a", "n_up_1p_i": null, "n_up_cr_r": null, "n_up_cr_i": null, "n_up_1f_i": "a", "y": 8, "p": 1 }
+{ "n_up_1p_r": null, "n_up_1p_i": null, "n_up_cr_i": "a", "n_up_1f_r": "b", "n_up_1f_i": "b", "x": "b", "y": 9, "p": 1 }
+{ "n_up_1p_i": "a", "n_up_cr_r": "b", "n_up_cr_i": "b", "n_up_1f_r": "b", "n_up_1f_i": "b", "x": "c", "y": 10, "p": 1 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.7.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.7.adm
new file mode 100644
index 0000000..2f7fdba
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.7.adm
@@ -0,0 +1,10 @@
+{ "n_3p_1p_r": null, "n_3p_1p_i": null, "n_3p_cr_r": null, "n_3p_cr_i": null, "n_3p_1f_r": "a", "n_3p_1f_i": null, "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": "a", "y": 1, "p": 0 }
+{ "n_3p_1p_r": null, "n_3p_1p_i": null, "n_3p_cr_r": "a", "n_3p_cr_i": null, "n_3p_1f_i": null, "n_3p_uf_r": "b", "n_3p_uf_i": "b", "y": 2, "p": 0 }
+{ "n_3p_1p_r": "a", "n_3p_1p_i": null, "n_3p_cr_i": null, "n_3p_1f_r": null, "n_3p_1f_i": "a", "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": null, "y": 3, "p": 0 }
+{ "n_3p_1p_i": null, "n_3p_cr_r": null, "n_3p_cr_i": "a", "n_3p_1f_r": "b", "n_3p_1f_i": "b", "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": "b", "y": 4, "p": 0 }
+{ "n_3p_1p_r": null, "n_3p_1p_i": null, "n_3p_cr_r": "b", "n_3p_cr_i": "b", "n_3p_1f_r": "b", "n_3p_1f_i": "b", "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": "c", "y": 5, "p": 0 }
+{ "n_3p_1p_r": null, "n_3p_1p_i": null, "n_3p_cr_r": null, "n_3p_cr_i": null, "n_3p_1f_r": "a", "n_3p_1f_i": null, "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": "a", "y": 6, "p": 1 }
+{ "n_3p_1p_r": null, "n_3p_1p_i": null, "n_3p_cr_r": "a", "n_3p_cr_i": null, "n_3p_1f_r": null, "n_3p_1f_i": null, "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": null, "y": 7, "p": 1 }
+{ "n_3p_1p_r": "a", "n_3p_1p_i": null, "n_3p_cr_r": null, "n_3p_cr_i": null, "n_3p_1f_i": "a", "n_3p_uf_r": "b", "n_3p_uf_i": "b", "y": 8, "p": 1 }
+{ "n_3p_1p_r": null, "n_3p_1p_i": null, "n_3p_cr_i": "a", "n_3p_1f_r": "b", "n_3p_1f_i": "b", "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": "b", "y": 9, "p": 1 }
+{ "n_3p_1p_i": null, "n_3p_cr_r": "b", "n_3p_cr_i": "b", "n_3p_1f_r": "b", "n_3p_1f_i": "b", "n_3p_uf_r": "b", "n_3p_uf_i": "b", "x": "c", "y": 10, "p": 1 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.8.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.8.adm
new file mode 100644
index 0000000..74de5a7
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.8.adm
@@ -0,0 +1,10 @@
+{ "n_cr_3f_r": null, "n_cr_3f_i": "a", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "x": "a", "y": 1, "p": 0 }
+{ "n_cr_3f_r": "b", "n_cr_3f_i": "b", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "y": 2, "p": 0 }
+{ "n_cr_3f_r": "b", "n_cr_3f_i": "b", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "x": null, "y": 3, "p": 0 }
+{ "n_cr_3f_r": "b", "n_cr_3f_i": "b", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "x": "b", "y": 4, "p": 0 }
+{ "n_cr_3f_r": null, "n_cr_3f_i": null, "n_cr_uf_r": null, "n_cr_uf_i": null, "x": "c", "y": 5, "p": 0 }
+{ "n_cr_3f_i": "a", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "x": "a", "y": 6, "p": 1 }
+{ "n_cr_3f_r": "b", "n_cr_3f_i": "b", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "x": null, "y": 7, "p": 1 }
+{ "n_cr_3f_r": "b", "n_cr_3f_i": "b", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "y": 8, "p": 1 }
+{ "n_cr_3f_r": "b", "n_cr_3f_i": "b", "n_cr_uf_r": "b", "n_cr_uf_i": "b", "x": "b", "y": 9, "p": 1 }
+{ "n_cr_3f_r": null, "n_cr_3f_i": null, "n_cr_uf_r": null, "n_cr_uf_i": null, "x": "c", "y": 10, "p": 1 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.9.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.9.adm
new file mode 100644
index 0000000..8840079
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/nth_value_01/nth_value_01.9.adm
@@ -0,0 +1,10 @@
+{ "n_1f_3f_r": null, "n_1f_3f_i": null, "n_1f_uf_r": "b", "n_1f_uf_i": "b", "x": "a", "y": 1, "p": 0 }
+{ "n_1f_3f_r": "b", "n_1f_3f_i": "b", "n_1f_uf_r": "b", "n_1f_uf_i": "b", "y": 2, "p": 0 }
+{ "n_1f_3f_r": "b", "n_1f_3f_i": "b", "n_1f_uf_r": "b", "n_1f_uf_i": "b", "x": null, "y": 3, "p": 0 }
+{ "n_1f_3f_r": null, "n_1f_3f_i": null, "n_1f_uf_r": null, "n_1f_uf_i": null, "x": "b", "y": 4, "p": 0 }
+{ "n_1f_3f_r": null, "n_1f_3f_i": null, "n_1f_uf_r": null, "n_1f_uf_i": null, "x": "c", "y": 5, "p": 0 }
+{ "n_1f_3f_i": null, "n_1f_uf_r": "b", "n_1f_uf_i": "b", "x": "a", "y": 6, "p": 1 }
+{ "n_1f_3f_r": "b", "n_1f_3f_i": "b", "n_1f_uf_r": "b", "n_1f_uf_i": "b", "x": null, "y": 7, "p": 1 }
+{ "n_1f_3f_r": "b", "n_1f_3f_i": "b", "n_1f_uf_r": "b", "n_1f_uf_i": "b", "y": 8, "p": 1 }
+{ "n_1f_3f_r": null, "n_1f_3f_i": null, "n_1f_uf_r": null, "n_1f_uf_i": null, "x": "b", "y": 9, "p": 1 }
+{ "n_1f_3f_r": null, "n_1f_3f_i": null, "n_1f_uf_r": null, "n_1f_uf_i": null, "x": "c", "y": 10, "p": 1 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 2b3cb77..a239497 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -6164,6 +6164,11 @@
</compilation-unit>
</test-case>
<test-case FilePath="misc">
+ <compilation-unit name="join-ASTERIXDB-2686">
+ <output-dir compare="Text">join-ASTERIXDB-2686</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="misc">
<compilation-unit name="poll-dynamic">
<output-dir compare="Text">poll-dynamic</output-dir>
</compilation-unit>
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/http/HttpServerRecordReaderFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/http/HttpServerRecordReaderFactory.java
index 944948b..d14071f 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/http/HttpServerRecordReaderFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/http/HttpServerRecordReaderFactory.java
@@ -36,6 +36,7 @@
import org.apache.hyracks.http.server.HttpServerConfigBuilder;
public class HttpServerRecordReaderFactory implements IRecordReaderFactory<char[]> {
+ private static final long serialVersionUID = -66399726369366305L;
private static final String KEY_CONFIGURATION_ADDRESSES = "addresses";
private static final String KEY_CONFIGURATION_PATH = "path";
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppToken.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppToken.java
index 13dca02..3669ae0 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppToken.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppToken.java
@@ -24,6 +24,7 @@
import org.apache.hyracks.api.exceptions.SourceLocation;
public abstract class SqlppToken implements Serializable {
+ private static final long serialVersionUID = -2974917383986695694L;
public SourceLocation sourceLocation;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIClientFactory.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIClientFactory.java
index dd0c028..ac2ecd0 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIClientFactory.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIClientFactory.java
@@ -28,6 +28,7 @@
import javax.net.ssl.SSLSocketFactory;
public class RMIClientFactory implements RMIClientSocketFactory, Serializable {
+ private static final long serialVersionUID = -3874278041718817394L;
private final boolean sslEnabled;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitAndDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitAndDescriptor.java
index 1c8b9dc..ef509fa 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitAndDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitAndDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitAndDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -140697639709011259L;
public static final IFunctionDescriptorFactory FACTORY = BitAndDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitClearDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitClearDescriptor.java
index 414f6a0..e3f9fd8 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitClearDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitClearDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitClearDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -1790134294538449161L;
public static final IFunctionDescriptorFactory FACTORY = BitClearDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitCountDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitCountDescriptor.java
index 8daa6b0..df30f3e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitCountDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitCountDescriptor.java
@@ -36,6 +36,7 @@
@MissingNullInOutFunction
public class BitCountDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -6355679338952487274L;
public static final IFunctionDescriptorFactory FACTORY = BitCountDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitNotDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitNotDescriptor.java
index 1fbbaf4..31d62a4 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitNotDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitNotDescriptor.java
@@ -36,6 +36,7 @@
@MissingNullInOutFunction
public class BitNotDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 549770812101511988L;
public static final IFunctionDescriptorFactory FACTORY = BitNotDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitOrDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitOrDescriptor.java
index d11b6af..37d231a 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitOrDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitOrDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitOrDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 3096119314615759635L;
public static final IFunctionDescriptorFactory FACTORY = BitOrDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitSetDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitSetDescriptor.java
index e72853d..e38fefc 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitSetDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitSetDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitSetDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -5710185389455313462L;
public static final IFunctionDescriptorFactory FACTORY = BitSetDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithRotateFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithRotateFlagDescriptor.java
index 6a59a6f..c8765ad 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithRotateFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithRotateFlagDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitShiftWithRotateFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -2277131079446466053L;
public static final IFunctionDescriptorFactory FACTORY = BitShiftWithRotateFlagDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithoutRotateFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithoutRotateFlagDescriptor.java
index 897b143..45422da 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithoutRotateFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitShiftWithoutRotateFlagDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitShiftWithoutRotateFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -2654547496459449684L;
public static final IFunctionDescriptorFactory FACTORY = BitShiftWithoutRotateFlagDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithAllFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithAllFlagDescriptor.java
index 5398e6b..c3741b2 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithAllFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithAllFlagDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitTestWithAllFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -2668646200589547517L;
public static final IFunctionDescriptorFactory FACTORY = BitTestWithAllFlagDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithoutAllFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithoutAllFlagDescriptor.java
index a2662c3..ae9519b 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithoutAllFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitTestWithoutAllFlagDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitTestWithoutAllFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -3124196321567262353L;
public static final IFunctionDescriptorFactory FACTORY = BitTestWithoutAllFlagDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitXorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitXorDescriptor.java
index edd1dcf..944f129 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitXorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/BitXorDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class BitXorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -1803337858721065395L;
public static final IFunctionDescriptorFactory FACTORY = BitXorDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithAllFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithAllFlagDescriptor.java
index f1cb704..5592342 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithAllFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithAllFlagDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class IsBitSetWithAllFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -2899093161460352528L;
public static final IFunctionDescriptorFactory FACTORY = IsBitSetWithAllFlagDescriptor::new;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithoutAllFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithoutAllFlagDescriptor.java
index e7cd674..0c4a326 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithoutAllFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/bitwise/IsBitSetWithoutAllFlagDescriptor.java
@@ -31,6 +31,7 @@
@MissingNullInOutFunction
public class IsBitSetWithoutAllFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = -1733575449220258856L;
public static final IFunctionDescriptorFactory FACTORY = IsBitSetWithoutAllFlagDescriptor::new;
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/AlgebricksStringBuilderWriter.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/AlgebricksStringBuilderWriter.java
index 2444ce8..f704dc0 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/AlgebricksStringBuilderWriter.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/AlgebricksStringBuilderWriter.java
@@ -29,6 +29,7 @@
*/
@NotThreadSafe
public class AlgebricksStringBuilderWriter extends StringBuilderWriter {
+ private static final long serialVersionUID = 61841252848797632L;
public AlgebricksStringBuilderWriter() {
super();
diff --git a/hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/win/WindowPartitionWriter.java b/hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/win/WindowPartitionWriter.java
index b3eb317..6a75f3c 100644
--- a/hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/win/WindowPartitionWriter.java
+++ b/hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/win/WindowPartitionWriter.java
@@ -104,7 +104,7 @@
copyToFrame(frameBuffer, writerFrame);
} else {
if (fileWriter == null) {
- FileReference file = ctx.getJobletContext().createManagedWorkspaceFile(fileNamePrefix);
+ FileReference file = ctx.createManagedWorkspaceFile(fileNamePrefix);
fileWriter = new RunFileWriter(file, ctx.getIoManager());
fileWriter.open();
}
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IWorkspaceFileFactory.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IWorkspaceFileFactory.java
index 9a35bb8..6859ec7 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IWorkspaceFileFactory.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IWorkspaceFileFactory.java
@@ -18,10 +18,26 @@
*/
package org.apache.hyracks.api.io;
+import org.apache.hyracks.api.context.IHyracksJobletContext;
+import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
public interface IWorkspaceFileFactory {
+
+ /**
+ * Creates an unmanaged file. Unmanaged files are not automatically deleted. The caller has to delete them.
+ *
+ * @param prefix a meaningful string to start the file name with.
+ */
public FileReference createUnmanagedWorkspaceFile(String prefix) throws HyracksDataException;
+ /**
+ * Creates a managed file. Managed files are automatically deleted at a certain point. This depends on which
+ * context the file is created in. Files created in the {@link IHyracksJobletContext job context} will be deleted
+ * as soon as the job is done. Files created in the {@link IHyracksTaskContext task context} will be deleted as
+ * soon as the task is done.
+ *
+ * @param prefix a meaningful string to start the file name with.
+ */
public FileReference createManagedWorkspaceFile(String prefix) throws HyracksDataException;
}
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/group/external/ExternalGroupWriteOperatorNodePushable.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/group/external/ExternalGroupWriteOperatorNodePushable.java
index 999dbac..e8a1b76 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/group/external/ExternalGroupWriteOperatorNodePushable.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/group/external/ExternalGroupWriteOperatorNodePushable.java
@@ -171,8 +171,7 @@
@Override
public RunFileWriter getRunFileWriter() throws HyracksDataException {
- FileReference newRun = ctx.getJobletContext()
- .createManagedWorkspaceFile(ExternalGroupOperatorDescriptor.class.getSimpleName());
+ FileReference newRun = ctx.createManagedWorkspaceFile(ExternalGroupOperatorDescriptor.class.getSimpleName());
return new RunFileWriter(newRun, ctx.getIoManager());
}
}
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java
index 6d2b485..45cccec 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java
@@ -434,6 +434,12 @@
if (isLeftOuter && pReader != null) {
appendNullToProbeTuples(pReader);
}
+ if (bReader != null) {
+ bReader.close();
+ }
+ if (pReader != null) {
+ pReader.close();
+ }
continue;
}
int bSize = state.hybridHJ.getBuildPartitionSizeInTup(pid);
@@ -628,6 +634,12 @@
// For the outer join, we don't reverse the role.
appendNullToProbeTuples(rprfw);
}
+ if (rbrfw != null) {
+ rbrfw.close();
+ }
+ if (rprfw != null) {
+ rprfw.close();
+ }
continue;
}
@@ -652,6 +664,12 @@
// For the outer join, we don't reverse the role.
appendNullToProbeTuples(rprfw);
}
+ if (rbrfw != null) {
+ rbrfw.close();
+ }
+ if (rprfw != null) {
+ rprfw.close();
+ }
continue;
}
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractExternalSortRunMerger.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractExternalSortRunMerger.java
index 08b2303..1beaab8 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractExternalSortRunMerger.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractExternalSortRunMerger.java
@@ -111,7 +111,7 @@
} finally {
mergeResultWriter.close();
}
- reader = mergeFileWriter.createReader();
+ reader = mergeFileWriter.createDeleteOnCloseReader();
}
runs.add(reader);