[ASTERIXDB-2345][FUN] Fix runtime output type for object_names()

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

Details:
- object_names() should produce ordered_list<string> instead of ordered_list<any>

Change-Id: I5181680bfe978d4208141a30b2167f78368bcf8d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2540
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordNamesDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordNamesDescriptor.java
index bb8e3e7..1719980 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordNamesDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordNamesDescriptor.java
@@ -31,6 +31,7 @@
 import org.apache.asterix.om.types.AOrderedListType;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
 import org.apache.asterix.runtime.evaluators.functions.PointableHelper;
 import org.apache.asterix.runtime.functions.FunctionTypeInferers;
@@ -78,6 +79,7 @@
                     private final IPointable argPtr = new VoidPointable();
                     private final ARecordPointable recordPointable =
                             (ARecordPointable) ARecordPointable.FACTORY.createPointable();
+                    private final AOrderedListType listType = new AOrderedListType(BuiltinType.ASTRING, null);
                     private final OrderedListBuilder listBuilder = new OrderedListBuilder();
                     private final ArrayBackedValueStorage itemStorage = new ArrayBackedValueStorage();
                     private final DataOutput itemOut = itemStorage.getDataOutput();
@@ -100,7 +102,7 @@
 
                         recordPointable.set(data, offset, argPtr.getLength());
 
-                        listBuilder.reset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE);
+                        listBuilder.reset(listType);
 
                         try {
                             for (int i = 0, n = recordPointable.getSchemeFieldCount(recType); i < n; i++) {