>From Hussain Towaileb <[email protected]>:

Hussain Towaileb has uploaded this change for review. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17793 )


Change subject: [ASTERIXDB-3267][EXT]: Ensure static part is also checked when 
evaluating for filter fields
......................................................................

[ASTERIXDB-3267][EXT]: Ensure static part is also checked when evaluating for 
filter fields

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Ensure static part is checked when evaluating for filter fields.
- Maintain the error stacktrace in case of external source failures.
- Add test cases.

Change-Id: I0c047c617887bf76623c5d30d87279c433c2f1af
---
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/professors/data.json
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/students/data.json
M asterixdb/asterix-app/src/test/resources/runtimets/only_external_dataset.xml
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.010.adm
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/RuntimeDataException.java
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/gcs/GCSInputStream.java
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/students/data.json
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/professors/data.json
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataPrefix.java
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/blob/AzureBlobInputStream.java
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.011.query.sqlpp
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/professors/data.json
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/filter/ExternalFilterValueEvaluator.java
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/courses/101/data.json
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.000.ddl.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.011.adm
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/professors/data.json
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.999.ddl.sqlpp
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/students/data.json
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/professors/data.json
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.011.adm
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.000.ddl.sqlpp
M 
asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/aws/s3/S3Utils.java
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.010.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.010.adm
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/datalake/AzureDataLakeInputStream.java
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/AwsS3InputStream.java
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/parquet/AwsS3ParquetReaderFactory.java
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.999.ddl.sqlpp
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/professors/data.json
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.010.query.sqlpp
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AbstractMultipleInputStream.java
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/courses/101/data.json
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.011.query.sqlpp
A 
asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/courses/101/data.json
38 files changed, 339 insertions(+), 36 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/93/17793/1

diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/professors/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/professors/data.json
new file mode 100644
index 0000000..7052c42
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/professors/data.json
@@ -0,0 +1 @@
+{ "id":  1 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/students/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/students/data.json
new file mode 100644
index 0000000..4b16428
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/accounting/students/data.json
@@ -0,0 +1 @@
+{ "id":  2 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/professors/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/professors/data.json
new file mode 100644
index 0000000..c1eff7c
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/professors/data.json
@@ -0,0 +1 @@
+{ "id":  3 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/students/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/students/data.json
new file mode 100644
index 0000000..35fedb8
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/engineering/students/data.json
@@ -0,0 +1 @@
+{ "id":  4 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/professors/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/professors/data.json
new file mode 100644
index 0000000..9808a46
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/professors/data.json
@@ -0,0 +1 @@
+{ "id":  5 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/students/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/students/data.json
new file mode 100644
index 0000000..fc5217b
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-1/department/hr/students/data.json
@@ -0,0 +1 @@
+{ "id":  6 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/courses/101/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/courses/101/data.json
new file mode 100644
index 0000000..4b16428
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/courses/101/data.json
@@ -0,0 +1 @@
+{ "id":  2 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/professors/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/professors/data.json
new file mode 100644
index 0000000..7052c42
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/accounting/professors/data.json
@@ -0,0 +1 @@
+{ "id":  1 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/courses/101/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/courses/101/data.json
new file mode 100644
index 0000000..35fedb8
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/courses/101/data.json
@@ -0,0 +1 @@
+{ "id":  4 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/professors/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/professors/data.json
new file mode 100644
index 0000000..c1eff7c
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/engineering/professors/data.json
@@ -0,0 +1 @@
+{ "id":  3 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/courses/101/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/courses/101/data.json
new file mode 100644
index 0000000..fc5217b
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/courses/101/data.json
@@ -0,0 +1 @@
+{ "id":  6 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/professors/data.json
 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/professors/data.json
new file mode 100644
index 0000000..9808a46
--- /dev/null
+++ 
b/asterixdb/asterix-app/data/json/external-filter/computed-field-between-static-parts-2/department/hr/professors/data.json
@@ -0,0 +1 @@
+{ "id":  5 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/only_external_dataset.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/only_external_dataset.xml
index 334dd52..1278304 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/only_external_dataset.xml
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/only_external_dataset.xml
@@ -19,5 +19,17 @@
  !-->
 <test-suite xmlns="urn:xml.testframework.asterix.apache.org" 
ResultOffsetPath="results" QueryOffsetPath="queries_sqlpp" 
QueryFileExtension=".sqlpp">
   <test-group name="failed">
+    <test-case FilePath="external-dataset/common/dynamic-prefixes">
+      <compilation-unit name="computed-field-between-static-parts">
+        <placeholder name="adapter" value="S3" />
+        <output-dir 
compare="Text">computed-field-between-static-parts</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="external-dataset/common/dynamic-prefixes/parquet">
+      <compilation-unit name="computed-field-between-static-parts">
+        <placeholder name="adapter" value="S3" />
+        <output-dir 
compare="Text">computed-field-between-static-parts</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
 </test-suite>
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.000.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.000.ddl.sqlpp
new file mode 100644
index 0000000..c9e1892
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.000.ddl.sqlpp
@@ -0,0 +1,41 @@
+/*
+ * 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;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE test AS {
+};
+
+CREATE EXTERNAL DATASET test1(test) USING %adapter% (
+    %template%,
+    ("container"="playground"),
+    
("definition"="external-filter/computed-field-between-static-parts-1/department/{name:string}/students"),
+    ("embed-filter-values" = "true"),
+    ("format"="json")
+);
+
+CREATE EXTERNAL DATASET test2(test) USING %adapter% (
+    %template%,
+    ("container"="playground"),
+    
("definition"="external-filter/computed-field-between-static-parts-2/department/{name:string}/courses/{courseId:int}"),
+    ("embed-filter-values" = "true"),
+    ("format"="json")
+);
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.010.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.010.query.sqlpp
new file mode 100644
index 0000000..7d47884
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.010.query.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.
+ */
+
+// param max-warnings:json=10
+
+USE test;
+
+SELECT value t
+FROM test1 t
+order by t.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.011.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.011.query.sqlpp
new file mode 100644
index 0000000..4eb2354
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.011.query.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.
+ */
+
+// param max-warnings:json=10
+
+USE test;
+
+SELECT value t
+FROM test2 t
+order by t.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.999.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.999.ddl.sqlpp
new file mode 100644
index 0000000..36b2bab
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/test.999.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/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.000.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.000.ddl.sqlpp
new file mode 100644
index 0000000..8897629
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.000.ddl.sqlpp
@@ -0,0 +1,41 @@
+/*
+ * 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;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE test AS {
+};
+
+CREATE EXTERNAL DATASET test1(test) USING %adapter% (
+    %template%,
+    ("container"="playground"),
+    
("definition"="parquet-data/external-filter/computed-field-between-static-parts-1/department/{name:string}/students"),
+    ("embed-filter-values" = "true"),
+    ("format"="parquet")
+);
+
+CREATE EXTERNAL DATASET test2(test) USING %adapter% (
+    %template%,
+    ("container"="playground"),
+    
("definition"="parquet-data/external-filter/computed-field-between-static-parts-2/department/{name:string}/courses/{courseId:int}"),
+    ("embed-filter-values" = "true"),
+    ("format"="parquet")
+);
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.010.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.010.query.sqlpp
new file mode 100644
index 0000000..7d47884
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.010.query.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.
+ */
+
+// param max-warnings:json=10
+
+USE test;
+
+SELECT value t
+FROM test1 t
+order by t.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.011.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.011.query.sqlpp
new file mode 100644
index 0000000..4eb2354
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.011.query.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.
+ */
+
+// param max-warnings:json=10
+
+USE test;
+
+SELECT value t
+FROM test2 t
+order by t.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.999.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.999.ddl.sqlpp
new file mode 100644
index 0000000..36b2bab
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/test.999.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/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.010.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.010.adm
new file mode 100644
index 0000000..f04c3d6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.010.adm
@@ -0,0 +1,3 @@
+{ "id": 2, "name": "accounting" }
+{ "id": 4, "name": "engineering" }
+{ "id": 6, "name": "hr" }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.011.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.011.adm
new file mode 100644
index 0000000..2fe19ff
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/computed-field-between-static-parts/result.011.adm
@@ -0,0 +1,3 @@
+{ "id": 2, "name": "accounting", "courseId": 101 }
+{ "id": 4, "name": "engineering", "courseId": 101 }
+{ "id": 6, "name": "hr", "courseId": 101 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.010.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.010.adm
new file mode 100644
index 0000000..f04c3d6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.010.adm
@@ -0,0 +1,3 @@
+{ "id": 2, "name": "accounting" }
+{ "id": 4, "name": "engineering" }
+{ "id": 6, "name": "hr" }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.011.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.011.adm
new file mode 100644
index 0000000..2fe19ff
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/parquet/computed-field-between-static-parts/result.011.adm
@@ -0,0 +1,3 @@
+{ "id": 2, "name": "accounting", "courseId": 101 }
+{ "id": 4, "name": "engineering", "courseId": 101 }
+{ "id": 6, "name": "hr", "courseId": 101 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
index c248cc2..a2b1589 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
@@ -262,6 +262,12 @@
         <output-dir compare="Text">not-in</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="external-dataset/common/dynamic-prefixes">
+      <compilation-unit name="computed-field-between-static-parts">
+        <placeholder name="adapter" value="S3" />
+        <output-dir compare="Text">not-in</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="external-dataset/common/dynamic-prefixes/parquet">
       <compilation-unit name="one-field">
         <placeholder name="adapter" value="S3" />
@@ -296,6 +302,12 @@
         <output-dir compare="Text">embed-multiple-values</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="external-dataset/common/dynamic-prefixes/parquet">
+      <compilation-unit name="computed-field-between-static-parts">
+        <placeholder name="adapter" value="S3" />
+        <output-dir compare="Text">not-in</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="external-dataset/common/dynamic-prefixes/csv">
       <compilation-unit name="embed-one-value">
         <placeholder name="adapter" value="S3" />
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/RuntimeDataException.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/RuntimeDataException.java
index 1a0a61f..95bcda7 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/RuntimeDataException.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/RuntimeDataException.java
@@ -31,6 +31,10 @@
         return new RuntimeDataException(error, params);
     }

+    public static RuntimeDataException create(ErrorCode error, Throwable 
cause, Serializable... params) {
+        return new RuntimeDataException(error, cause, params);
+    }
+
     public RuntimeDataException(ErrorCode errorCode, Throwable cause, 
SourceLocation sourceLoc,
             Serializable... params) {
         super(errorCode, cause, sourceLoc, params);
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/filter/ExternalFilterValueEvaluator.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/filter/ExternalFilterValueEvaluator.java
index acf1d61..9deb886 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/filter/ExternalFilterValueEvaluator.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/filter/ExternalFilterValueEvaluator.java
@@ -19,7 +19,6 @@
 package org.apache.asterix.external.input.filter;

 import java.io.DataOutput;
-import java.io.IOException;

 import 
org.apache.asterix.dataflow.data.nontagged.serde.AStringSerializerDeserializer;
 import 
org.apache.asterix.dataflow.data.nontagged.serde.SerializerDeserializerUtil;
@@ -48,7 +47,7 @@
         value.reset();
         try {
             writeValue(typeTag, stringValue, value, stringSerDer);
-        } catch (IOException e) {
+        } catch (Exception e) {
             throw HyracksDataException.create(e);
         }
     }
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/AwsS3InputStream.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/AwsS3InputStream.java
index 56feb8a..f2ede19 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/AwsS3InputStream.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/AwsS3InputStream.java
@@ -92,7 +92,7 @@
                 return false;
             } catch (S3Exception ex) {
                 if (!shouldRetry(ex.awsErrorDetails().errorCode(), retries++)) 
{
-                    throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                    throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
                 }
                 LOGGER.debug(() -> "S3 retryable error: " + 
LogRedactionUtil.userData(ex.getMessage()));

@@ -103,7 +103,7 @@
                     Thread.currentThread().interrupt();
                 }
             } catch (SdkException ex) {
-                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
             }
         }
         return true;
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/parquet/AwsS3ParquetReaderFactory.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/parquet/AwsS3ParquetReaderFactory.java
index f335538..abed33a 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/parquet/AwsS3ParquetReaderFactory.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/parquet/AwsS3ParquetReaderFactory.java
@@ -88,11 +88,11 @@
             configureAwsS3HdfsJobConf(conf, configuration, numberOfPartitions);
             configureHdfsConf(conf, configuration);
         } catch (SdkException | SdkBaseException ex) {
-            throw new RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         } catch (AlgebricksException ex) {
             Throwable root = ExceptionUtils.getRootCause(ex);
             if (root instanceof SdkException || root instanceof 
SdkBaseException) {
-                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(root));
+                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, root, 
getMessageOrToString(root));
             }
             throw ex;
         }
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/blob/AzureBlobInputStream.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/blob/AzureBlobInputStream.java
index 52d16c1..db4fdb0 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/blob/AzureBlobInputStream.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/blob/AzureBlobInputStream.java
@@ -75,10 +75,10 @@
                         + "found in container " + container);
                 return false;
             } else {
-                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
             }
         } catch (Exception ex) {
-            throw new RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }

         return true;
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/datalake/AzureDataLakeInputStream.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/datalake/AzureDataLakeInputStream.java
index ba47d57..9b16026 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/datalake/AzureDataLakeInputStream.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/azure/datalake/AzureDataLakeInputStream.java
@@ -75,10 +75,10 @@
                         + "found in container " + container);
                 return false;
             } else {
-                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
             }
         } catch (Exception ex) {
-            throw new RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }

         return true;
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/gcs/GCSInputStream.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/gcs/GCSInputStream.java
index ebc9907..89da065 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/gcs/GCSInputStream.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/gcs/GCSInputStream.java
@@ -96,7 +96,7 @@
                 break;
             } catch (BaseServiceException ex) {
                 if (!ex.isRetryable() || !shouldRetry(++attempt)) {
-                    throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                    throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
                 }
                 LOGGER.debug(() -> "Retryable error: " + 
getMessageOrToString(ex));

@@ -107,7 +107,7 @@
                     Thread.currentThread().interrupt();
                 }
             } catch (Exception ex) {
-                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                throw new 
RuntimeDataException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
             }
         }
         return true;
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AbstractMultipleInputStream.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AbstractMultipleInputStream.java
index 18ef150..dcc8a61 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AbstractMultipleInputStream.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AbstractMultipleInputStream.java
@@ -80,7 +80,8 @@
             }
             return result;
         } catch (Exception e) {
-            throw RuntimeDataException.create(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ExceptionUtils.getMessageOrToString(e));
+            throw RuntimeDataException.create(ErrorCode.EXTERNAL_SOURCE_ERROR, 
e,
+                    ExceptionUtils.getMessageOrToString(e));
         }
     }
 }
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataPrefix.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataPrefix.java
index 394295d..cc949f8 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataPrefix.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataPrefix.java
@@ -243,16 +243,23 @@
         // TODO provide the List to avoid array creation
         List<String> keySegments = extractPrefixSegments(key);

-        // no computed fields filter, accept path
-        if (!hasComputedFields() || evaluator.isEmpty()) {
-            return true;
-        }
-
         // segments of object key have to be larger than segments of the prefix
         if (keySegments.size() <= segments.size()) {
             return false;
         }

+        // before doing any computed field evaluation, make sure the static 
part matches
+        for (int i = 0; i < segments.size(); i++) {
+            if (!computedFieldSegmentIndexes.contains(i) && 
!keySegments.get(i).equals(segments.get(i))) {
+                return false;
+            }
+        }
+
+        // no computed fields filter, accept path
+        if (!hasComputedFields() || evaluator.isEmpty()) {
+            return true;
+        }
+
         // no computed fields used in WHERE clause, accept object
         if (evaluator.isEmpty()) {
             return true;
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/aws/s3/S3Utils.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/aws/s3/S3Utils.java
index 966b536..650f823 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/aws/s3/S3Utils.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/aws/s3/S3Utils.java
@@ -186,10 +186,10 @@
                 try {
                     builder.endpointOverride(uri);
                 } catch (NullPointerException ex) {
-                    throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                    throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
                 }
             } catch (URISyntaxException ex) {
-                throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR,
+                throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex,
                         String.format("Invalid service endpoint %s", 
serviceEndpoint));
             }
         }
@@ -308,10 +308,10 @@
                     throw ex;
                 }
             } catch (SdkException ex2) {
-                throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex2, 
getMessageOrToString(ex));
             }
         } catch (SdkException ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         } finally {
             if (s3Client != null) {
                 CleanupUtils.close(s3Client, null);
@@ -385,10 +385,10 @@
                     throw ex;
                 }
             } catch (SdkException ex2) {
-                throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, getMessageOrToString(ex));
+                throw new 
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex2, 
getMessageOrToString(ex));
             }
         } catch (SdkException ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         } finally {
             if (s3Client != null) {
                 CleanupUtils.close(s3Client, null);
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
index 4062fc9..1250267 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
@@ -222,7 +222,7 @@
                         pemCertificate.invoke(certificate, certificateContent, 
clientCertificatePassword);
                     }
                 } catch (NoSuchMethodException | InvocationTargetException | 
IllegalAccessException ex) {
-                    throw new CompilationException(EXTERNAL_SOURCE_ERROR, 
ex.getMessage());
+                    throw new CompilationException(EXTERNAL_SOURCE_ERROR, ex, 
ex.getMessage());
                 }
                 builder.credential(certificate.build());
             }
@@ -242,7 +242,7 @@
         try {
             return builder.buildClient();
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }
     }

@@ -375,7 +375,7 @@
                         pemCertificate.invoke(certificate, certificateContent, 
clientCertificatePassword);
                     }
                 } catch (NoSuchMethodException | InvocationTargetException | 
IllegalAccessException ex) {
-                    throw new CompilationException(EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+                    throw new CompilationException(EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
                 }
                 builder.credential(certificate.build());
             }
@@ -395,7 +395,7 @@
         try {
             return builder.buildClient();
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }
     }

@@ -434,7 +434,7 @@
                 warningCollector.warn(warning);
             }
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }

         return filesOnly;
@@ -488,7 +488,7 @@
                 warningCollector.warn(warning);
             }
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }

         return filesOnly;
@@ -554,7 +554,7 @@
         } catch (CompilationException ex) {
             throw ex;
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }
     }

@@ -593,7 +593,7 @@
         } catch (CompilationException ex) {
             throw ex;
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }
     }

diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
index e5ff733..bbd36de 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
@@ -103,13 +103,13 @@
             try {
                 
builder.setCredentials(GoogleCredentials.getApplicationDefault());
             } catch (IOException ex) {
-                throw CompilationException.create(EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+                throw CompilationException.create(EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
             }
         } else if (jsonCredentials != null) {
             try (InputStream credentialsStream = new 
ByteArrayInputStream(jsonCredentials.getBytes())) {
                 
builder.setCredentials(GoogleCredentials.fromStream(credentialsStream));
             } catch (IOException ex) {
-                throw new CompilationException(EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+                throw new CompilationException(EXTERNAL_SOURCE_ERROR, ex, 
getMessageOrToString(ex));
             }
         } else {
             builder.setCredentials(NoCredentials.getInstance());
@@ -152,7 +152,7 @@
         } catch (CompilationException ex) {
             throw ex;
         } catch (Exception ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }
     }

@@ -169,7 +169,7 @@
         try {
             items = gcs.list(container, options);
         } catch (BaseServiceException ex) {
-            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
getMessageOrToString(ex));
+            throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, 
ex, getMessageOrToString(ex));
         }

         // Collect the paths to files only

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17793
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I0c047c617887bf76623c5d30d87279c433c2f1af
Gerrit-Change-Number: 17793
Gerrit-PatchSet: 1
Gerrit-Owner: Hussain Towaileb <[email protected]>
Gerrit-MessageType: newchange

Reply via email to