[NO ISSUE][EXT] Fix JRecord setField for open fields

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

Details:
setField method should be able to handle open fields.

Change-Id: I4ec185d62e78e8100215334bc656586268314797
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3068
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-library/keyword_detector/keyword_detector.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-library/keyword_detector/keyword_detector.1.ddl.sqlpp
index 4402130..464ecb2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-library/keyword_detector/keyword_detector.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-library/keyword_detector/keyword_detector.1.ddl.sqlpp
@@ -35,8 +35,7 @@
 };
 
 create type DetectResultType as open{
-id:int64,
-sensitive: boolean
+id:int64
 };
 
 create dataset EmpDataset(InputRecordType) primary key id;
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JRecord.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JRecord.java
index 7fa9d0b..10c228d 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JRecord.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JRecord.java
@@ -99,11 +99,7 @@
         if (pos >= 0) {
             fields[pos] = fieldValue;
         } else {
-            if (openFields.get(fieldName) != null) {
-                openFields.put(fieldName, fieldValue);
-            } else {
-                throw new RuntimeDataException(ErrorCode.LIBRARY_JAVA_JOBJECTS_UNKNOWN_FIELD, fieldName);
-            }
+            openFields.put(fieldName, fieldValue);
         }
     }