ASTERIXDB-1356: report file not found

Change-Id: Ia12bf84adfd8442103567df42ac22e5750e1360f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/771
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <hubailmor@gmail.com>
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/file-not-found/file-not-found.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/load/file-not-found/file-not-found.1.ddl.aql
new file mode 100644
index 0000000..37a8f14
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/load/file-not-found/file-not-found.1.ddl.aql
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+/**
+ * Test loading from a file that does not exist.
+ * Expected result: fail - File not found.
+ */
+
+drop dataverse broken if exists;
+create dataverse broken;
+use dataverse broken;
+
+create type xtype as closed { id: int32 };
+create dataset X(xtype) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/file-not-found/file-not-found.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/load/file-not-found/file-not-found.2.update.aql
new file mode 100644
index 0000000..c26ffd5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/load/file-not-found/file-not-found.2.update.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/**
+ * Test loading from a file that does not exist.
+ * Expected result: fail - File not found.
+ */
+
+use dataverse broken;
+
+load dataset X using localfs(
+  ("path"="asterix_nc1://bla"),
+  ("format"="delimited-text"),
+  ("delimiter"="|")
+);
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index e4e12f3..0ce4103 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -6343,6 +6343,12 @@
                 <!-- <expected-error>org.apache.hyracks.api.exceptions.HyracksException</expected-error> -->
             </compilation-unit>
         </test-case>
+        <test-case FilePath="load">
+            <compilation-unit name="file-not-found">
+              <output-dir compare="Text">none</output-dir>
+              <expected-error>org.apache.hyracks.api.exceptions.HyracksDataException: bla: path not found</expected-error>
+            </compilation-unit>
+        </test-case>
         <test-case FilePath="user-defined-functions">
             <compilation-unit name="query-issue244">
                 <output-dir compare="Text">query-issue244</output-dir>