Adding introspection for getting record details.
Change-Id: Iba15acff0f6830cffbc33d9dac3b5f0c417be844
diff --git a/asterix-app/data/classifications/animals.adm b/asterix-app/data/classifications/animals.adm
new file mode 100644
index 0000000..953f083
--- /dev/null
+++ b/asterix-app/data/classifications/animals.adm
@@ -0,0 +1,4 @@
+{ "id": 1, "class": { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } } }
+{ "id": 2, "class": { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } } }
+{ "id": 3, "class": { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } } }
+{ "id": 4, "class": { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } } }
diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml
index 2db0974..cad13ce 100644
--- a/asterix-app/pom.xml
+++ b/asterix-app/pom.xml
@@ -7,221 +7,224 @@
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ! See the
License for the specific language governing permissions and ! limitations
under the License. ! -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>asterix</artifactId>
- <groupId>edu.uci.ics.asterix</groupId>
- <version>0.8.7-SNAPSHOT</version>
- </parent>
- <artifactId>asterix-app</artifactId>
-
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>A business-friendly OSS license</comments>
- </license>
- </licenses>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- <fork>true</fork>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>appassembler-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <configuration>
- <programs>
- <program>
- <mainClass>edu.uci.ics.asterix.drivers.AsterixWebServer</mainClass>
- <name>asterix-web</name>
- </program>
- <program>
- <mainClass>edu.uci.ics.asterix.drivers.AsterixClientDriver</mainClass>
- <name>asterix-cmd</name>
- </program>
- <program>
- <mainClass>edu.uci.ics.asterix.drivers.AsterixCLI</mainClass>
- <name>asterix-cli</name>
- </program>
- </programs>
- <repositoryLayout>flat</repositoryLayout>
- <repositoryName>lib</repositoryName>
- </configuration>
- <phase>package</phase>
- <goals>
- <goal>assemble</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-5</version>
- <executions>
- <execution>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/binary-assembly.xml</descriptor>
- </descriptors>
- </configuration>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>asterix</artifactId>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <version>0.8.7-SNAPSHOT</version>
+ </parent>
+ <artifactId>asterix-app</artifactId>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>8.0.0.M2</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>8.0.0.M2</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.hyracks</groupId>
- <artifactId>hyracks-control-cc</artifactId>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.hyracks</groupId>
- <artifactId>hyracks-control-nc</artifactId>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.hyracks</groupId>
- <artifactId>algebricks-compiler</artifactId>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.hyracks</groupId>
- <artifactId>hyracks-client</artifactId>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-algebra</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-aql</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-om</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-metadata</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-tools</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-common</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-common</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ <comments>A business-friendly OSS license</comments>
+ </license>
+ </licenses>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ <fork>true</fork>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>appassembler-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <configuration>
+ <programs>
+ <program>
+ <mainClass>edu.uci.ics.asterix.drivers.AsterixWebServer</mainClass>
+ <name>asterix-web</name>
+ </program>
+ <program>
+ <mainClass>edu.uci.ics.asterix.drivers.AsterixClientDriver</mainClass>
+ <name>asterix-cmd</name>
+ </program>
+ <program>
+ <mainClass>edu.uci.ics.asterix.drivers.AsterixCLI</mainClass>
+ <name>asterix-cli</name>
+ </program>
+ </programs>
+ <repositoryLayout>flat</repositoryLayout>
+ <repositoryName>lib</repositoryName>
+ </configuration>
+ <phase>package</phase>
+ <goals>
+ <goal>assemble</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <executions>
+ <execution>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/binary-assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>8.0.0.M2</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>8.0.0.M2</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.hyracks</groupId>
+ <artifactId>hyracks-control-cc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.hyracks</groupId>
+ <artifactId>hyracks-control-nc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.hyracks</groupId>
+ <artifactId>algebricks-compiler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.hyracks</groupId>
+ <artifactId>hyracks-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-algebra</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-aql</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-om</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-metadata</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-tools</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-common</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-common</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<!-- posssible remove this <dependency> <groupId>com.kenai.nbpwr</groupId>
<artifactId>org-apache-commons-io</artifactId> <version>1.3.1-201002241208</version>
<scope>test</scope> </dependency> -->
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-transactions</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client</artifactId>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs</artifactId>
- <type>jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.1</version>
- <type>jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>edu.uci.ics.asterix</groupId>
- <artifactId>asterix-test-framework</artifactId>
- <version>0.8.7-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-transactions</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client</artifactId>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs</artifactId>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>edu.uci.ics.asterix</groupId>
+ <artifactId>asterix-test-framework</artifactId>
+ <version>0.8.7-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
</dependency>
<dependency>
- <groupId>com.e-movimento.tinytools</groupId>
+ <groupId>com.e-movimento.tinytools</groupId>
<artifactId>privilegedaccessor</artifactId>
<version>1.2.2</version>
</dependency>
- </dependencies>
+ </dependencies>
</project>
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
index a1c5348..91aa897 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -32,16 +32,15 @@
public class AsterixHyracksIntegrationUtil {
- public static final String[] NC_IDS = { "nc1", "nc2" };
- public static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
+ public static final int NODES = 2;
+ public static final int PARTITONS = 2;
public static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
public static final int DEFAULT_HYRACKS_CC_CLUSTER_PORT = 1099;
private static ClusterControllerService cc;
- private static NodeControllerService nc1;
- private static NodeControllerService nc2;
+ private static NodeControllerService[] ncs = new NodeControllerService[NODES];
private static IHyracksClientConnection hcc;
public static void init() throws Exception {
@@ -58,48 +57,61 @@
cc = new ClusterControllerService(ccConfig);
cc.start();
- NCConfig ncConfig1 = new NCConfig();
- ncConfig1.ccHost = "localhost";
- ncConfig1.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT;
- ncConfig1.clusterNetIPAddress = "127.0.0.1";
- ncConfig1.dataIPAddress = "127.0.0.1";
- ncConfig1.resultIPAddress = "127.0.0.1";
- ncConfig1.nodeId = NC_IDS[0];
- ncConfig1.resultTTL = 30000;
- ncConfig1.resultSweepThreshold = 1000;
- ncConfig1.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + "nc1/iodevice0" + ","
- + System.getProperty("java.io.tmpdir") + File.separator + "nc1/iodevice1";
- ncConfig1.appNCMainClass = NCApplicationEntryPoint.class.getName();
- nc1 = new NodeControllerService(ncConfig1);
- nc1.start();
-
- NCConfig ncConfig2 = new NCConfig();
- ncConfig2.ccHost = "localhost";
- ncConfig2.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT;
- ncConfig2.clusterNetIPAddress = "127.0.0.1";
- ncConfig2.dataIPAddress = "127.0.0.1";
- ncConfig2.resultIPAddress = "127.0.0.1";
- ncConfig2.nodeId = NC_IDS[1];
- ncConfig2.resultTTL = 30000;
- ncConfig2.resultSweepThreshold = 1000;
- ncConfig2.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + "nc2/iodevice0" + ","
- + System.getProperty("java.io.tmpdir") + File.separator + "nc2/iodevice1";
- ncConfig2.appNCMainClass = NCApplicationEntryPoint.class.getName();
- nc2 = new NodeControllerService(ncConfig2);
- nc2.start();
+ int n = 0;
+ for (String ncName : getNcNames()) {
+ NCConfig ncConfig1 = new NCConfig();
+ ncConfig1.ccHost = "localhost";
+ ncConfig1.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT;
+ ncConfig1.clusterNetIPAddress = "127.0.0.1";
+ ncConfig1.dataIPAddress = "127.0.0.1";
+ ncConfig1.resultIPAddress = "127.0.0.1";
+ ncConfig1.nodeId = ncName;
+ ncConfig1.resultTTL = 30000;
+ ncConfig1.resultSweepThreshold = 1000;
+ for (int p = 0; p < PARTITONS; ++p) {
+ if (p == 0) {
+ ncConfig1.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + ncConfig1.nodeId
+ + "/iodevice" + p;
+ } else {
+ ncConfig1.ioDevices += "," + System.getProperty("java.io.tmpdir") + File.separator
+ + ncConfig1.nodeId + "/iodevice" + p;
+ }
+ }
+ ncConfig1.appNCMainClass = NCApplicationEntryPoint.class.getName();
+ ncs[n] = new NodeControllerService(ncConfig1);
+ ncs[n].start();
+ ++n;
+ }
hcc = new HyracksConnection(cc.getConfig().clientNetIpAddress, cc.getConfig().clientNetPort);
}
+ public static String[] getNcNames() {
+ String[] names = new String[NODES];
+ for (int n = 0; n < NODES; ++n) {
+ names[n] = "nc" + (n + 1);
+ }
+ return names;
+ }
+
+ public static String[] getDataDirs() {
+ String[] names = new String[NODES];
+ for (int n = 0; n < NODES; ++n) {
+ names[n] = "nc" + (n + 1) + "data";
+ }
+ return names;
+ }
+
public static IHyracksClientConnection getHyracksClientConnection() {
return hcc;
}
public static void deinit() throws Exception {
- if (nc2 != null)
- nc2.stop();
- if (nc1 != null)
- nc1.stop();
+ for (int n = 0; n < ncs.length; ++n) {
+ if (ncs[n] != null)
+ ncs[n].stop();
+
+ }
if (cc != null)
cc.stop();
}
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
index 0197d4a..069c5aa 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
@@ -73,13 +73,13 @@
}
// clean up the files written by the ASTERIX storage manager
- for (String d : AsterixHyracksIntegrationUtil.ASTERIX_DATA_DIRS) {
+ for (String d : AsterixHyracksIntegrationUtil.getDataDirs()) {
TestsUtils.deleteRec(new File(d));
}
}
private static void deleteTransactionLogs() throws Exception {
- for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) {
+ for (String ncId : AsterixHyracksIntegrationUtil.getNcNames()) {
File log = new File(txnProperties.getLogDirectory(ncId));
if (log.exists()) {
FileUtils.deleteDirectory(log);
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index 7171642..58531aa 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -89,7 +89,7 @@
}
private static void deleteTransactionLogs() throws Exception {
- for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) {
+ for (String ncId : AsterixHyracksIntegrationUtil.getNcNames()) {
File log = new File(txnProperties.getLogDirectory(ncId));
if (log.exists()) {
FileUtils.deleteDirectory(log);
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
index 3e5b734..8547eb0 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -44,16 +44,15 @@
@RunWith(Parameterized.class)
public class ExecutionTest {
- private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName());
+ protected static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName());
- private static final String PATH_ACTUAL = "rttest" + File.separator;
- private static final String PATH_BASE = StringUtils.join(new String[] { "src", "test", "resources", "runtimets" },
- File.separator);
+ protected static final String PATH_ACTUAL = "rttest" + File.separator;
+ protected static final String PATH_BASE = StringUtils.join(
+ new String[] { "src", "test", "resources", "runtimets" }, File.separator);
- private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
- private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
+ protected static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
- private static AsterixTransactionProperties txnProperties;
+ protected static AsterixTransactionProperties txnProperties;
@BeforeClass
public static void setUp() throws Exception {
@@ -96,14 +95,14 @@
outdir.delete();
}
// clean up the files written by the ASTERIX storage manager
- for (String d : ASTERIX_DATA_DIRS) {
+ for (String d : AsterixHyracksIntegrationUtil.getDataDirs()) {
TestsUtils.deleteRec(new File(d));
}
HDFSCluster.getInstance().cleanup();
}
private static void deleteTransactionLogs() throws Exception {
- for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) {
+ for (String ncId : AsterixHyracksIntegrationUtil.getNcNames()) {
File log = new File(txnProperties.getLogDirectory(ncId));
if (log.exists()) {
FileUtils.deleteDirectory(log);
@@ -120,7 +119,7 @@
return testArgs;
}
- private static Collection<Object[]> buildTestsInXml(String xmlfile) throws Exception {
+ protected static Collection<Object[]> buildTestsInXml(String xmlfile) throws Exception {
Collection<Object[]> testArgs = new ArrayList<Object[]>();
TestCaseContext.Builder b = new TestCaseContext.Builder();
for (TestCaseContext ctx : b.build(new File(PATH_BASE), xmlfile)) {
@@ -130,7 +129,7 @@
}
- private TestCaseContext tcCtx;
+ protected TestCaseContext tcCtx;
public ExecutionTest(TestCaseContext tcCtx) {
this.tcCtx = tcCtx;
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java
new file mode 100644
index 0000000..faeb688
--- /dev/null
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.test.runtime;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Collection;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
+
+import edu.uci.ics.asterix.test.aql.TestsUtils;
+import edu.uci.ics.asterix.test.runtime.RepeatRule.Repeat;
+import edu.uci.ics.asterix.testframework.context.TestCaseContext;
+
+/**
+ * Runs runtime test cases that have been identified in the repeatedtestsuite.xml.
+ *
+ * Each test is run 10000 times.
+ */
+class RepeatRule implements MethodRule {
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ java.lang.annotation.ElementType.METHOD })
+ public @interface Repeat {
+ public abstract int times();
+
+ }
+
+ private static class RepeatStatement extends Statement {
+
+ private final int times;
+ private final Statement statement;
+
+ private RepeatStatement(int times, Statement statement) {
+ this.times = times;
+ this.statement = statement;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ for (int i = 0; i < times; i++) {
+ statement.evaluate();
+ }
+ }
+ }
+
+ @Override
+ public Statement apply(Statement statement, FrameworkMethod method, Object target) {
+ Statement result = statement;
+ Repeat repeat = method.getAnnotation(Repeat.class);
+ if (repeat != null) {
+ int times = repeat.times();
+ result = new RepeatStatement(times, statement);
+ }
+ return result;
+
+ }
+}
+
+@RunWith(Parameterized.class)
+public class RepeatedTest extends ExecutionTest {
+
+ private int count;
+
+ @Parameters
+ public static Collection<Object[]> tests() throws Exception {
+ Collection<Object[]> testArgs = buildTestsInXml(TestCaseContext.DEFAULT_REPEADED_TESTSUITE_XML_NAME);
+ return testArgs;
+ }
+
+ public RepeatedTest(TestCaseContext tcCtx) {
+ super(tcCtx);
+ count = 0;
+ }
+
+ @Rule
+ public RepeatRule repeatRule = new RepeatRule();
+
+ @Test
+ @Repeat(times = 10000)
+ public void test() throws Exception {
+ System.err.println("***** Test Count: " + (++count) + " ******");
+ TestsUtils.executeTest(PATH_ACTUAL, tcCtx, null, false);
+ }
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml b/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml
new file mode 100644
index 0000000..283cdea
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml
@@ -0,0 +1,127 @@
+<!--
+ ! Copyright 2009-2013 by The Regents of the University of California
+ ! Licensed 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 from
+ !
+ ! 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-case FilePath="records">
+ <compilation-unit name="access-nested-fields">
+ <output-dir compare="Text">access-nested-fields</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="closed-record-constructor_01">
+ <output-dir compare="Text">closed-record-constructor_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="closed-record-constructor_02">
+ <output-dir compare="Text">closed-record-constructor_02</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="closed-record-constructor_03">
+ <output-dir compare="Text">closed-record-constructor_03</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="expFieldName">
+ <output-dir compare="Text">expFieldName</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="field-access-by-index_01">
+ <output-dir compare="Text">field-access-by-index_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="field-access-on-open-field">
+ <output-dir compare="Text">field-access-on-open-field</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-fields">
+ <compilation-unit name="documentation-example">
+ <output-dir compare="Text">documentation-example</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-fields">
+ <compilation-unit name="tiny-social-example">
+ <output-dir compare="Text">tiny-social-example</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-fields">
+ <compilation-unit name="tiny-social-example-no-complex-types">
+ <output-dir compare="Text">tiny-social-example-no-complex-types</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-fields">
+ <compilation-unit name="tiny-social-example-only-lists">
+ <output-dir compare="Text">tiny-social-example-only-lists</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-fields">
+ <compilation-unit name="tiny-social-example-only-records">
+ <output-dir compare="Text">tiny-social-example-only-records</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-field-value">
+ <compilation-unit name="documentation-example">
+ <output-dir compare="Text">documentation-example</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-field-value">
+ <compilation-unit name="highly-nested-closed">
+ <output-dir compare="Text">highly-nested-closed</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-field-value">
+ <compilation-unit name="highly-nested-mixed">
+ <output-dir compare="Text">highly-nested-mixed</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-field-value">
+ <compilation-unit name="highly-nested-open">
+ <output-dir compare="Text">highly-nested-open</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records/get-record-field-value">
+ <compilation-unit name="tiny-social-example">
+ <output-dir compare="Text">tiny-social-example</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="open-record-constructor_01">
+ <output-dir compare="Text">open-record-constructor_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="open-record-constructor_02">
+ <output-dir compare="Text">open-record-constructor_02</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="closed-closed-fieldname-conflict_issue173">
+ <output-dir compare="Text">closed-closed-fieldname-conflict_issue173</output-dir>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="open-closed-fieldname-conflict_issue173">
+ <output-dir compare="Text">open-closed-fieldname-conflict_issue173</output-dir>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="records">
+ <compilation-unit name="open-open-fieldname-conflict_issue173">
+ <output-dir compare="Text">open-open-fieldname-conflict_issue173</output-dir>
+ <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+ </compilation-unit>
+ </test-case>
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql
new file mode 100644
index 0000000..6681a75
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql
@@ -0,0 +1,60 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type S as open{
+ id: int64
+}
+
+create type GS as closed{
+ id: int64,
+ Genus: string,
+ lower: S
+}
+
+create type FGS as open{
+ id: int64,
+ Family: string
+}
+
+create type OFGS as closed{
+ id: int64,
+ Order: string,
+ lower: FGS
+}
+
+create type COFGS as closed{
+ id: int64,
+ Class: string,
+ lower: OFGS
+}
+
+create type PCOFGS as closed{
+ id: int64,
+ Phylum: string,
+ lower: COFGS
+}
+
+create type KPCOFGS as open{
+ id: int64,
+ Kingdom: string
+}
+
+create type Classification as closed{
+ id: int64,
+ fullClassification:KPCOFGS
+}
+
+create type Animal as open{
+ id: int64
+}
+
+create dataset Animals(Animal)
+primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql
new file mode 100644
index 0000000..f7198ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql
new file mode 100644
index 0000000..262bee1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql
new file mode 100644
index 0000000..2b28594
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql
new file mode 100644
index 0000000..73ce6f5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+
+use dataverse test;
+
+load dataset Animals using localfs
+(("path"="nc1://data/classifications/animals.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql
new file mode 100644
index 0000000..e92f44e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql
@@ -0,0 +1,12 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower.lower.lower.lower.lower.lower.Species
+order by $result
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql
new file mode 100644
index 0000000..6e8e9c8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql
@@ -0,0 +1,12 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower.lower.lower.lower.lower.lower
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql
new file mode 100644
index 0000000..718129a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql
@@ -0,0 +1,12 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower.lower.lower.lower.lower
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql
new file mode 100644
index 0000000..5ee7ad6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql
@@ -0,0 +1,12 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower.lower.lower.lower
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql
new file mode 100644
index 0000000..30d6496
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql
@@ -0,0 +1,12 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower.lower.lower
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql
new file mode 100644
index 0000000..fd9c55d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower.lower
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql
new file mode 100644
index 0000000..a4fff3d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Access a records nested records at each level.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := $test.class.fullClassification.lower
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql
new file mode 100644
index 0000000..2876ebf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+ let $r1 := {"id":1,
+ "project":"AsterixDB",
+ "address":{"city":"Irvine", "state":"CA"},
+ "related":["Hivestrix", "Preglix", "Apache VXQuery"] }
+ return get-record-field-value($r1, "project")
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql
new file mode 100644
index 0000000..c1d2b5d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+ let $r1 := {"id":1,
+ "project":"AsterixDB",
+ "address":{"city":"Irvine", "state":"CA"},
+ "related":["Hivestrix", "Preglix", "Apache VXQuery"] }
+ return get-record-field-value($r1, "address")
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql
new file mode 100644
index 0000000..6be3409
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+ let $r1 := {"id": 1,
+ "project": "AsterixDB",
+ "address": { "city": "Irvine", "state": "CA" },
+ "related": [ "Hivestrix", "Preglix", "Apache VXQuery" ] }
+ return get-record-field-value($r1, "related")
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql
new file mode 100644
index 0000000..f36f1bc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql
@@ -0,0 +1,63 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type S as closed{
+ id: int64,
+ Species: string
+}
+
+create type GS as closed{
+ id: int64,
+ Genus: string,
+ lower: S
+}
+
+create type FGS as closed{
+ id: int64,
+ Family: string,
+ lower:GS
+}
+
+create type OFGS as closed{
+ id: int64,
+ Order: string,
+ lower: FGS
+}
+
+create type COFGS as closed{
+ id: int64,
+ Class: string,
+ lower: OFGS
+}
+
+create type PCOFGS as closed{
+ id: int64,
+ Phylum: string,
+ lower: COFGS
+}
+
+create type KPCOFGS as closed{
+ id: int64,
+ Kingdom: string,
+ lower: PCOFGS
+}
+
+create type Classification as closed{
+ id: int64,
+ fullClassification:KPCOFGS
+}
+
+create type Animal as closed{
+ id: int64,
+ class: Classification
+}
+
+create dataset Animals(Animal)
+primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql
new file mode 100644
index 0000000..7b270b9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql
@@ -0,0 +1,9 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+load dataset Animals using localfs
+(("path"="nc1://data/classifications/animals.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql
new file mode 100644
index 0000000..8634bde
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := get-record-field-value($test, "class")
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql
new file mode 100644
index 0000000..eff94c8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql
@@ -0,0 +1,59 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type S as open{
+ id: int64
+}
+
+create type GS as closed{
+ id: int64,
+ Genus: string,
+ lower: S
+}
+
+create type FGS as open{
+ id: int64,
+ Family: string
+}
+
+create type OFGS as closed{
+ id: int64,
+ Order: string,
+ lower: FGS
+}
+
+create type COFGS as open{
+ id: int64,
+ Class: string,
+ lower: OFGS
+}
+
+create type PCOFGS as closed{
+ id: int64,
+ Phylum: string,
+ lower: COFGS
+}
+
+create type KPCOFGS as open{
+ id: int64,
+ Kingdom: string
+}
+
+create type Classification as closed{
+ id: int64,
+ fullClassification:KPCOFGS
+}
+
+create type Animal as open{
+ id: int64
+}
+
+create dataset Animals(Animal)
+primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql
new file mode 100644
index 0000000..7b270b9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql
@@ -0,0 +1,9 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+load dataset Animals using localfs
+(("path"="nc1://data/classifications/animals.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql
new file mode 100644
index 0000000..8634bde
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := get-record-field-value($test, "class")
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql
new file mode 100644
index 0000000..32a8aaa
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql
@@ -0,0 +1,54 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type S as open{
+ id: int64
+}
+
+create type GS as open{
+ id: int64,
+ Genus: string
+}
+
+create type FGS as open{
+ id: int64,
+ Family: string
+}
+
+create type OFGS as open{
+ id: int64,
+ Order: string
+}
+
+create type COFGS as open{
+ id: int64,
+ Class: string
+}
+
+create type PCOFGS as open{
+ id: int64,
+ Phylum: string
+}
+
+create type KPCOFGS as open{
+ id: int64,
+ Kingdom: string
+}
+
+create type Classification as open{
+ id: int64
+}
+
+create type Animal as open{
+ id: int64
+}
+
+create dataset Animals(Animal)
+primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql
new file mode 100644
index 0000000..7b270b9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql
@@ -0,0 +1,9 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+load dataset Animals using localfs
+(("path"="nc1://data/classifications/animals.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql
new file mode 100644
index 0000000..8634bde
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql
@@ -0,0 +1,11 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse test;
+
+for $test in dataset Animals
+let $result := get-record-field-value($test, "class")
+order by $result.id
+return $result;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql
new file mode 100644
index 0000000..b167657
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql
@@ -0,0 +1,49 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type TwitterUserType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64,
+ name: string,
+ followers_count: int64
+}
+
+create type TweetMessageType as closed {
+ tweetid: string,
+ user: TwitterUserType,
+ sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+}
+
+create type EmploymentType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ friend-ids: {{ int64 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql
new file mode 100644
index 0000000..dfc09cc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql
@@ -0,0 +1,24 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+create dataset FacebookUsers(FacebookUserType)
+primary key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
+
+create dataset TwitterUsers(TwitterUserType)
+primary key screen-name;
+
+create dataset TweetMessages(TweetMessageType)
+primary key tweetid
+hints(cardinality=100);
+
+create index fbUserSinceIdx on FacebookUsers(user-since);
+create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+create index fbMessageIdx on FacebookMessages(message) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql
new file mode 100644
index 0000000..f45cfa7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql
@@ -0,0 +1,18 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+load dataset FacebookUsers using localfs
+(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+load dataset FacebookMessages using localfs
+(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm"));
+
+load dataset TwitterUsers using localfs
+(("path"="nc1://data/tinysocial/twu.adm"),("format"="adm"));
+
+load dataset TweetMessages using localfs
+(("path"="nc1://data/tinysocial/twm.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql
new file mode 100644
index 0000000..1a560e5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql
@@ -0,0 +1,13 @@
+/*
+* Description : Testing get-record-field-value under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessages
+for $f in get-record-fields($r)
+where $f.field-type = "STRING"
+let $result := get-record-field-value($r, $f.field-name)
+order by $result
+return $result
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql
new file mode 100644
index 0000000..84df51e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+ let $r1 := {"id":1,
+ "project":"AsterixDB",
+ "address":{"city":"Irvine", "state":"CA"},
+ "related":["Hivestrix", "Preglix", "Apache VXQuery"] }
+ return get-record-fields($r1)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql
new file mode 100644
index 0000000..4ae62c8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql
@@ -0,0 +1,83 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type TwitterUserType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageType as closed {
+ tweetid: string,
+ user: TwitterUserType,
+ sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+}
+
+create type EmploymentType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ friend-ids: {{ int64 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
+
+// Alternate datasets
+create type TwitterUserAlternateType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageAlternateType as closed {
+ tweetid: string,
+ sender-location: point?,
+ send-time: datetime,
+ message-text: string
+}
+
+create type EmploymentAlternateType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserAlternateType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime
+}
+
+create type FacebookMessageAlternateType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.2.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.2.ddl.aql
new file mode 100644
index 0000000..023bd60
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.2.ddl.aql
@@ -0,0 +1,38 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+create dataset FacebookUsers(FacebookUserType)
+primary key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
+
+create dataset TwitterUsers(TwitterUserType)
+primary key screen-name;
+
+create dataset TweetMessages(TweetMessageType)
+primary key tweetid
+hints(cardinality=100);
+
+create index fbUserSinceIdx on FacebookUsers(user-since);
+create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+create index fbMessageIdx on FacebookMessages(message) type keyword;
+
+
+// Alternate datasets
+create dataset FacebookUsersAlternate(FacebookUserAlternateType)
+primary key id;
+
+create dataset FacebookMessagesAlternate(FacebookMessageAlternateType)
+primary key message-id;
+
+create dataset TwitterUsersAlternate(TwitterUserAlternateType)
+primary key screen-name;
+
+create dataset TweetMessagesAlternate(TweetMessageAlternateType)
+primary key tweetid;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.3.update.aql
new file mode 100644
index 0000000..8207681
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.3.update.aql
@@ -0,0 +1,61 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+load dataset FacebookUsers using localfs
+(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+load dataset FacebookMessages using localfs
+(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm"));
+
+load dataset TwitterUsers using localfs
+(("path"="nc1://data/tinysocial/twu.adm"),("format"="adm"));
+
+load dataset TweetMessages using localfs
+(("path"="nc1://data/tinysocial/twm.adm"),("format"="adm"));
+
+
+// Alternate datasets
+insert into dataset TwitterUsersAlternate(
+ for $r in dataset TwitterUsers
+ return {
+ "screen-name" : $r.screen-name,
+ "lang" : $r.lang,
+ "friends_count" : $r.friends_count,
+ "statuses_count" : $r.statuses_count
+ }
+);
+
+insert into dataset TweetMessagesAlternate(
+ for $r in dataset TweetMessages
+ return {
+ "tweetid" : $r.tweetid,
+ "sender-location" : $r.sender-location,
+ "send-time" : $r.send-time,
+ "message-text" : $r.message-text
+ }
+);
+
+insert into dataset FacebookUsersAlternate(
+ for $r in dataset FacebookUsers
+ return {
+ "id" : $r.id,
+ "alias" : $r.alias,
+ "name" : $r.name,
+ "user-since" : $r.user-since
+ }
+);
+
+insert into dataset FacebookMessagesAlternate(
+ for $r in dataset FacebookMessages
+ return {
+ "message-id" : $r.message-id,
+ "author-id" : $r.author-id,
+ "in-response-to" : $r.in-response-to,
+ "sender-location" : $r.sender-location,
+ "message" : $r.message
+ }
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.query.aql
new file mode 100644
index 0000000..5bdc255
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $user in dataset FacebookUsersAlternate
+where $user.id = 8
+return get-record-fields($user);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.query.aql
new file mode 100644
index 0000000..0af5656
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookUsersAlternate
+order by $r.id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.query.aql
new file mode 100644
index 0000000..ad5d424
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookMessagesAlternate
+order by $r.message-id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.query.aql
new file mode 100644
index 0000000..72d49f0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TwitterUsersAlternate
+order by $r.screen-name
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.query.aql
new file mode 100644
index 0000000..698660b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessagesAlternate
+order by $r.tweetid
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.query.aql
new file mode 100644
index 0000000..1c56ca5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.query.aql
@@ -0,0 +1,13 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessagesAlternate
+ for $f in get-record-fields($r)
+ group by $n:=$f.field-name, $t:=$f.field-type with $r
+ let $count:=count($r)
+ order by $n, $t
+ return {"field-name":$n, "field-type":$t, "count":$count};
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.1.ddl.aql
new file mode 100644
index 0000000..e858f7c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.1.ddl.aql
@@ -0,0 +1,85 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type TwitterUserType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageType as closed {
+ tweetid: string,
+ user: TwitterUserType,
+ sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+}
+
+create type EmploymentType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ friend-ids: {{ int64 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
+
+// Alternate datasets
+create type TwitterUserAlternateType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageAlternateType as closed {
+ tweetid: string,
+ sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+}
+
+create type EmploymentAlternateType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserAlternateType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ friend-ids: {{ int64 }},
+ user-since: datetime
+}
+
+create type FacebookMessageAlternateType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.2.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.2.ddl.aql
new file mode 100644
index 0000000..023bd60
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.2.ddl.aql
@@ -0,0 +1,38 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+create dataset FacebookUsers(FacebookUserType)
+primary key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
+
+create dataset TwitterUsers(TwitterUserType)
+primary key screen-name;
+
+create dataset TweetMessages(TweetMessageType)
+primary key tweetid
+hints(cardinality=100);
+
+create index fbUserSinceIdx on FacebookUsers(user-since);
+create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+create index fbMessageIdx on FacebookMessages(message) type keyword;
+
+
+// Alternate datasets
+create dataset FacebookUsersAlternate(FacebookUserAlternateType)
+primary key id;
+
+create dataset FacebookMessagesAlternate(FacebookMessageAlternateType)
+primary key message-id;
+
+create dataset TwitterUsersAlternate(TwitterUserAlternateType)
+primary key screen-name;
+
+create dataset TweetMessagesAlternate(TweetMessageAlternateType)
+primary key tweetid;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.3.update.aql
new file mode 100644
index 0000000..e4a515b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.3.update.aql
@@ -0,0 +1,63 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+load dataset FacebookUsers using localfs
+(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+load dataset FacebookMessages using localfs
+(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm"));
+
+load dataset TwitterUsers using localfs
+(("path"="nc1://data/tinysocial/twu.adm"),("format"="adm"));
+
+load dataset TweetMessages using localfs
+(("path"="nc1://data/tinysocial/twm.adm"),("format"="adm"));
+
+
+// Alternate datasets
+insert into dataset TwitterUsersAlternate(
+ for $r in dataset TwitterUsers
+ return {
+ "screen-name" : $r.screen-name,
+ "lang" : $r.lang,
+ "friends_count" : $r.friends_count,
+ "statuses_count" : $r.statuses_count
+ }
+);
+
+insert into dataset TweetMessagesAlternate(
+ for $r in dataset TweetMessages
+ return {
+ "tweetid" : $r.tweetid,
+ "sender-location" : $r.sender-location,
+ "send-time" : $r.send-time,
+ "message-text" : $r.message-text,
+ "referred-topics" : $r.referred-topics
+ }
+);
+
+insert into dataset FacebookUsersAlternate(
+ for $r in dataset FacebookUsers
+ return {
+ "id" : $r.id,
+ "alias" : $r.alias,
+ "name" : $r.name,
+ "friend-ids" : $r.friend-ids,
+ "user-since" : $r.user-since
+ }
+);
+
+insert into dataset FacebookMessagesAlternate(
+ for $r in dataset FacebookMessages
+ return {
+ "message-id" : $r.message-id,
+ "author-id" : $r.author-id,
+ "in-response-to" : $r.in-response-to,
+ "sender-location" : $r.sender-location,
+ "message" : $r.message
+ }
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.query.aql
new file mode 100644
index 0000000..5bdc255
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $user in dataset FacebookUsersAlternate
+where $user.id = 8
+return get-record-fields($user);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.query.aql
new file mode 100644
index 0000000..0af5656
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookUsersAlternate
+order by $r.id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.query.aql
new file mode 100644
index 0000000..ad5d424
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookMessagesAlternate
+order by $r.message-id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.query.aql
new file mode 100644
index 0000000..72d49f0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TwitterUsersAlternate
+order by $r.screen-name
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.query.aql
new file mode 100644
index 0000000..698660b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessagesAlternate
+order by $r.tweetid
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.query.aql
new file mode 100644
index 0000000..d7cf8d0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.query.aql
@@ -0,0 +1,13 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessagesAlternate
+for $f in get-record-fields($r)
+group by $n:=$f.field-name, $t:=$f.field-type with $r
+let $count:=count($r)
+order by $n, $t
+return {"field-name":$n, "field-type":$t, "count":$count};
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ddl.aql
new file mode 100644
index 0000000..d87c812
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ddl.aql
@@ -0,0 +1,85 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type TwitterUserType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageType as closed {
+ tweetid: string,
+ user: TwitterUserType,
+ sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+}
+
+create type EmploymentType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ friend-ids: {{ int64 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
+
+// Alternate datasets
+create type TwitterUserAlternateType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageAlternateType as closed {
+ tweetid: string,
+ user: TwitterUserAlternateType,
+ sender-location: point?,
+ send-time: datetime,
+ message-text: string
+}
+
+create type EmploymentAlternateType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserAlternateType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ employment: EmploymentAlternateType
+}
+
+create type FacebookMessageAlternateType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ddl.aql
new file mode 100644
index 0000000..023bd60
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ddl.aql
@@ -0,0 +1,38 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+create dataset FacebookUsers(FacebookUserType)
+primary key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
+
+create dataset TwitterUsers(TwitterUserType)
+primary key screen-name;
+
+create dataset TweetMessages(TweetMessageType)
+primary key tweetid
+hints(cardinality=100);
+
+create index fbUserSinceIdx on FacebookUsers(user-since);
+create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+create index fbMessageIdx on FacebookMessages(message) type keyword;
+
+
+// Alternate datasets
+create dataset FacebookUsersAlternate(FacebookUserAlternateType)
+primary key id;
+
+create dataset FacebookMessagesAlternate(FacebookMessageAlternateType)
+primary key message-id;
+
+create dataset TwitterUsersAlternate(TwitterUserAlternateType)
+primary key screen-name;
+
+create dataset TweetMessagesAlternate(TweetMessageAlternateType)
+primary key tweetid;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.3.update.aql
new file mode 100644
index 0000000..a2282f5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.3.update.aql
@@ -0,0 +1,63 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+load dataset FacebookUsers using localfs
+(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+load dataset FacebookMessages using localfs
+(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm"));
+
+load dataset TwitterUsers using localfs
+(("path"="nc1://data/tinysocial/twu.adm"),("format"="adm"));
+
+load dataset TweetMessages using localfs
+(("path"="nc1://data/tinysocial/twm.adm"),("format"="adm"));
+
+
+// Alternate datasets
+insert into dataset TwitterUsersAlternate(
+ for $r in dataset TwitterUsers
+ return {
+ "screen-name" : $r.screen-name,
+ "lang" : $r.lang,
+ "friends_count" : $r.friends_count,
+ "statuses_count" : $r.statuses_count
+ }
+);
+
+insert into dataset TweetMessagesAlternate(
+ for $r in dataset TweetMessages
+ return {
+ "tweetid" : $r.tweetid,
+ "user" : $r.user,
+ "sender-location" : $r.sender-location,
+ "send-time" : $r.send-time,
+ "message-text" : $r.message-text
+ }
+);
+
+insert into dataset FacebookUsersAlternate(
+ for $r in dataset FacebookUsers
+ return {
+ "id" : $r.id,
+ "alias" : $r.alias,
+ "name" : $r.name,
+ "user-since" : $r.user-since,
+ "employment" : $r.employment[0]
+ }
+);
+
+insert into dataset FacebookMessagesAlternate(
+ for $r in dataset FacebookMessages
+ return {
+ "message-id" : $r.message-id,
+ "author-id" : $r.author-id,
+ "in-response-to" : $r.in-response-to,
+ "sender-location" : $r.sender-location,
+ "message" : $r.message
+ }
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.query.aql
new file mode 100644
index 0000000..5bdc255
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $user in dataset FacebookUsersAlternate
+where $user.id = 8
+return get-record-fields($user);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.query.aql
new file mode 100644
index 0000000..0af5656
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookUsersAlternate
+order by $r.id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.query.aql
new file mode 100644
index 0000000..ad5d424
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookMessagesAlternate
+order by $r.message-id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.query.aql
new file mode 100644
index 0000000..72d49f0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TwitterUsersAlternate
+order by $r.screen-name
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.query.aql
new file mode 100644
index 0000000..698660b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessagesAlternate
+order by $r.tweetid
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.query.aql
new file mode 100644
index 0000000..d7cf8d0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.query.aql
@@ -0,0 +1,13 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessagesAlternate
+for $f in get-record-fields($r)
+group by $n:=$f.field-name, $t:=$f.field-type with $r
+let $count:=count($r)
+order by $n, $t
+return {"field-name":$n, "field-type":$t, "count":$count};
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.1.ddl.aql
new file mode 100644
index 0000000..b9e6a70
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.1.ddl.aql
@@ -0,0 +1,47 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type TwitterUserType as open {
+ screen-name: string,
+ lang: string,
+ friends_count: int64,
+ statuses_count: int64
+}
+
+create type TweetMessageType as closed {
+ tweetid: string,
+ user: TwitterUserType,
+ sender-location: point?,
+ send-time: datetime,
+ referred-topics: {{ string }},
+ message-text: string
+}
+
+create type EmploymentType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int64,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ friend-ids: {{ int64 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int64,
+ author-id: int64,
+ in-response-to: int64?,
+ sender-location: point?,
+ message: string
+}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.2.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.2.ddl.aql
new file mode 100644
index 0000000..079f6e2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.2.ddl.aql
@@ -0,0 +1,24 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+create dataset FacebookUsers(FacebookUserType)
+primary key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
+
+create dataset TwitterUsers(TwitterUserType)
+primary key screen-name;
+
+create dataset TweetMessages(TweetMessageType)
+primary key tweetid
+hints(cardinality=100);
+
+create index fbUserSinceIdx on FacebookUsers(user-since);
+create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+create index fbMessageIdx on FacebookMessages(message) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.3.update.aql
new file mode 100644
index 0000000..f2cb06a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.3.update.aql
@@ -0,0 +1,18 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+load dataset FacebookUsers using localfs
+(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+load dataset FacebookMessages using localfs
+(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm"));
+
+load dataset TwitterUsers using localfs
+(("path"="nc1://data/tinysocial/twu.adm"),("format"="adm"));
+
+load dataset TweetMessages using localfs
+(("path"="nc1://data/tinysocial/twm.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.4.query.aql
new file mode 100644
index 0000000..fb4a402
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.4.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+where $user.id = 8
+return get-record-fields($user);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.5.query.aql
new file mode 100644
index 0000000..8f7359e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.5.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookUsers
+order by $r.id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.6.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.6.query.aql
new file mode 100644
index 0000000..b3129e8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.6.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset FacebookMessages
+order by $r.message-id
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.7.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.7.query.aql
new file mode 100644
index 0000000..b979dd7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.7.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TwitterUsers
+order by $r.screen-name
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.8.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.8.query.aql
new file mode 100644
index 0000000..48b8e6e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.8.query.aql
@@ -0,0 +1,10 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessages
+order by $r.tweetid
+return get-record-fields($r);
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.9.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.9.query.aql
new file mode 100644
index 0000000..d30a74e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example/tiny-social-example.9.query.aql
@@ -0,0 +1,13 @@
+/*
+* Description : Testing get-record-fields under different queries.
+* Expected Res : Success
+* Date : 04 Jun 2015
+*/
+use dataverse TinySocial;
+
+for $r in dataset TweetMessages
+for $f in get-record-fields($r)
+group by $n:=$f.field-name, $t:=$f.field-type with $r
+let $count:=count($r)
+order by $n, $t
+return {"field-name":$n, "field-type":$t, "count":$count};
diff --git a/asterix-app/src/test/resources/runtimets/repeatedtestsuite.xml b/asterix-app/src/test/resources/runtimets/repeatedtestsuite.xml
new file mode 100644
index 0000000..e4bbc73
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/repeatedtestsuite.xml
@@ -0,0 +1,31 @@
+<!--
+ ! Copyright 2009-2013 by The Regents of the University of California
+ ! Licensed 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 from
+ !
+ ! 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-suite
+ xmlns="urn:xml.testframework.asterix.ics.uci.edu"
+ ResultOffsetPath="results"
+ QueryOffsetPath="queries"
+ QueryFileExtension=".aql">
+ <!-- By default no test are listed here. This is only for individual testing purposes. -->
+ <!-- The following test case is commented out as an example. -->
+ <test-group name="repeated-tests">
+<!--
+ <test-case FilePath="records/get-record-fields">
+ <compilation-unit name="tiny-social-example">
+ <output-dir compare="Text">tiny-social-example</output-dir>
+ </compilation-unit>
+ </test-case>
+-->
+ </test-group>
+</test-suite>
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.10.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.10.adm
new file mode 100644
index 0000000..ba62392
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.10.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } }
+, { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } }
+, { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } }
+, { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.11.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.11.adm
new file mode 100644
index 0000000..e04c4d4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.11.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } }
+, { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } }
+, { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } }
+, { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } }
+ ]
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.12.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.12.adm
new file mode 100644
index 0000000..57e9e86
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.12.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "class": { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } } }
+, { "id": 2, "class": { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } } }
+, { "id": 3, "class": { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } } }
+, { "id": 4, "class": { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.3.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.3.adm
new file mode 100644
index 0000000..87e1291
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.3.adm
@@ -0,0 +1,5 @@
+[ "Gulo"
+, "Hyracoidea"
+, "Jamaicensis"
+, "Johnstoni"
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.4.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.4.adm
new file mode 100644
index 0000000..f724405
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.4.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Species": "Gulo" }
+, { "id": 2, "Species": "Johnstoni" }
+, { "id": 3, "Species": "Hyracoidea" }
+, { "id": 4, "Species": "Jamaicensis" }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.5.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.5.adm
new file mode 100644
index 0000000..f84fa4d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.5.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } }
+, { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } }
+, { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } }
+, { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.6.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.6.adm
new file mode 100644
index 0000000..656d0c3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.6.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } }
+, { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } }
+, { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } }
+, { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } }
+ ]
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.7.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.7.adm
new file mode 100644
index 0000000..67b9b86
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.7.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } }
+, { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } }
+, { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } }
+, { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.8.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.8.adm
new file mode 100644
index 0000000..99cb0ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.8.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } }
+, { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } }
+, { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } }
+, { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } }
+ ]
diff --git a/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.9.adm b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.9.adm
new file mode 100644
index 0000000..bdf5ca5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/access-nested-fields/access-nested-fields.9.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } }
+, { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } }
+, { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } }
+, { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.1.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.1.adm
new file mode 100644
index 0000000..0616231
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.1.adm
@@ -0,0 +1,2 @@
+[ "AsterixDB"
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.2.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.2.adm
new file mode 100644
index 0000000..985b94e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.2.adm
@@ -0,0 +1,2 @@
+[ { "city": "Irvine", "state": "CA" }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.3.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.3.adm
new file mode 100644
index 0000000..802f510
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/documentation-example/documentation-example.3.adm
@@ -0,0 +1,2 @@
+[ [ "Hivestrix", "Preglix", "Apache VXQuery" ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-closed/highly-nested-closed.3.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-closed/highly-nested-closed.3.adm
new file mode 100644
index 0000000..67d992c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-closed/highly-nested-closed.3.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } }
+, { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } }
+, { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } }
+, { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.adm
new file mode 100644
index 0000000..67d992c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } }
+, { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } }
+, { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } }
+, { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-open/highly-nested-open.3.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-open/highly-nested-open.3.adm
new file mode 100644
index 0000000..67d992c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/highly-nested-open/highly-nested-open.3.adm
@@ -0,0 +1,5 @@
+[ { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } }
+, { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } }
+, { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } }
+, { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/tiny-social-example/tiny-social-example.4.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/tiny-social-example/tiny-social-example.4.adm
new file mode 100644
index 0000000..0f002f4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-field-value/tiny-social-example/tiny-social-example.4.adm
@@ -0,0 +1,25 @@
+[ " can't stand iphone its platform is terrible"
+, " can't stand motorola its speed is terrible:("
+, " hate verizon its voice-clarity is OMG:("
+, " like iphone the voice-clarity is good:)"
+, " like motorola the speed is good:)"
+, " like samsung the platform is good"
+, " like samsung the voice-command is amazing:)"
+, " like sprint the voice-command is mind-blowing:)"
+, " like t-mobile the shortcut-menu is awesome:)"
+, " like verizon its shortcut-menu is awesome:)"
+, " love t-mobile its customization is good:)"
+, " love verizon its voicemail-service is awesome"
+, "1"
+, "10"
+, "11"
+, "12"
+, "2"
+, "3"
+, "4"
+, "5"
+, "6"
+, "7"
+, "8"
+, "9"
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/documentation-example/documentation-example.1.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/documentation-example/documentation-example.1.adm
new file mode 100644
index 0000000..ff67a9e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/documentation-example/documentation-example.1.adm
@@ -0,0 +1,2 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "project", "field-type": "STRING", "is-open": false }, { "field-name": "address", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "city", "field-type": "STRING", "is-open": false }, { "field-name": "state", "field-type": "STRING", "is-open": false } ] }, { "field-name": "related", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" }, { "field-type": "STRING" } ] } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.adm
new file mode 100644
index 0000000..ea66e8b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.adm
@@ -0,0 +1,2 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.adm
new file mode 100644
index 0000000..43b6e20
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.adm
@@ -0,0 +1,11 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.adm
new file mode 100644
index 0000000..8fdd58c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.adm
@@ -0,0 +1,16 @@
+[ [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.adm
new file mode 100644
index 0000000..c2e6792
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.adm
@@ -0,0 +1,5 @@
+[ [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.adm
new file mode 100644
index 0000000..66a276d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.adm
@@ -0,0 +1,13 @@
+[ [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.adm
new file mode 100644
index 0000000..d5d7282
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.adm
@@ -0,0 +1,5 @@
+[ { "count": 12, "field-name": "message-text", "field-type": "STRING" }
+, { "count": 12, "field-name": "send-time", "field-type": "DATETIME" }
+, { "count": 12, "field-name": "sender-location", "field-type": "POINT" }
+, { "count": 12, "field-name": "tweetid", "field-type": "STRING" }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.adm
new file mode 100644
index 0000000..9a34a4f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.adm
@@ -0,0 +1,2 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.adm
new file mode 100644
index 0000000..32ffe1a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.adm
@@ -0,0 +1,11 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.adm
new file mode 100644
index 0000000..8fdd58c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.adm
@@ -0,0 +1,16 @@
+[ [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.adm
new file mode 100644
index 0000000..c2e6792
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.adm
@@ -0,0 +1,5 @@
+[ [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.adm
new file mode 100644
index 0000000..52770b2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.adm
@@ -0,0 +1,13 @@
+[ [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+ ]
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.adm
new file mode 100644
index 0000000..237f229
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.adm
@@ -0,0 +1,6 @@
+[ { "count": 12, "field-name": "message-text", "field-type": "STRING" }
+, { "count": 12, "field-name": "referred-topics", "field-type": "UNORDEREDLIST" }
+, { "count": 12, "field-name": "send-time", "field-type": "DATETIME" }
+, { "count": 12, "field-name": "sender-location", "field-type": "POINT" }
+, { "count": 12, "field-name": "tweetid", "field-type": "STRING" }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.adm
new file mode 100644
index 0000000..bea13da
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.adm
@@ -0,0 +1,2 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.adm
new file mode 100644
index 0000000..304abae
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.adm
@@ -0,0 +1,11 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "employment", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.adm
new file mode 100644
index 0000000..8fdd58c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.adm
@@ -0,0 +1,16 @@
+[ [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.adm
new file mode 100644
index 0000000..c2e6792
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.adm
@@ -0,0 +1,5 @@
+[ [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.adm
new file mode 100644
index 0000000..bf9b501
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.adm
@@ -0,0 +1,13 @@
+[ [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.adm
new file mode 100644
index 0000000..d831c10
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.adm
@@ -0,0 +1,6 @@
+[ { "count": 12, "field-name": "message-text", "field-type": "STRING" }
+, { "count": 12, "field-name": "send-time", "field-type": "DATETIME" }
+, { "count": 12, "field-name": "sender-location", "field-type": "POINT" }
+, { "count": 12, "field-name": "tweetid", "field-type": "STRING" }
+, { "count": 12, "field-name": "user", "field-type": "RECORD" }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.4.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.4.adm
new file mode 100644
index 0000000..3822ce7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.4.adm
@@ -0,0 +1,2 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.5.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.5.adm
new file mode 100644
index 0000000..d5a41d3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.5.adm
@@ -0,0 +1,11 @@
+[ [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+, [ { "field-name": "id", "field-type": "INT64", "is-open": false }, { "field-name": "alias", "field-type": "STRING", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": false }, { "field-name": "user-since", "field-type": "DATETIME", "is-open": false }, { "field-name": "friend-ids", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "INT64" }, { "field-type": "INT64" }, { "field-type": "INT64" } ] }, { "field-name": "employment", "field-type": "ORDEREDLIST", "is-open": false, "list": [ { "field-type": "RECORD", "nested": [ { "field-name": "organization-name", "field-type": "STRING", "is-open": false }, { "field-name": "start-date", "field-type": "DATE", "is-open": false }, { "field-name": "end-date", "field-type": "DATE", "is-open": false } ] } ] } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.6.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.6.adm
new file mode 100644
index 0000000..8fdd58c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.6.adm
@@ -0,0 +1,16 @@
+[ [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "message-id", "field-type": "INT64", "is-open": false }, { "field-name": "author-id", "field-type": "INT64", "is-open": false }, { "field-name": "in-response-to", "field-type": "INT64", "is-open": false }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "message", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.7.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.7.adm
new file mode 100644
index 0000000..55daef6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.7.adm
@@ -0,0 +1,5 @@
+[ [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ]
+, [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.8.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.8.adm
new file mode 100644
index 0000000..7a1ca5d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.8.adm
@@ -0,0 +1,13 @@
+[ [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+, [ { "field-name": "tweetid", "field-type": "STRING", "is-open": false }, { "field-name": "user", "field-type": "RECORD", "is-open": false, "nested": [ { "field-name": "screen-name", "field-type": "STRING", "is-open": false }, { "field-name": "lang", "field-type": "STRING", "is-open": false }, { "field-name": "friends_count", "field-type": "INT64", "is-open": false }, { "field-name": "statuses_count", "field-type": "INT64", "is-open": false }, { "field-name": "name", "field-type": "STRING", "is-open": true }, { "field-name": "followers_count", "field-type": "INT64", "is-open": true } ] }, { "field-name": "sender-location", "field-type": "POINT", "is-open": false }, { "field-name": "send-time", "field-type": "DATETIME", "is-open": false }, { "field-name": "referred-topics", "field-type": "UNORDEREDLIST", "is-open": false, "list": [ { "field-type": "STRING" }, { "field-type": "STRING" } ] }, { "field-name": "message-text", "field-type": "STRING", "is-open": false } ]
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.9.adm b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.9.adm
new file mode 100644
index 0000000..898d763
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/records/get-record-fields/tiny-social-example/tiny-social-example.9.adm
@@ -0,0 +1,7 @@
+[ { "count": 12, "field-name": "message-text", "field-type": "STRING" }
+, { "count": 12, "field-name": "referred-topics", "field-type": "UNORDEREDLIST" }
+, { "count": 12, "field-name": "send-time", "field-type": "DATETIME" }
+, { "count": 12, "field-name": "sender-location", "field-type": "POINT" }
+, { "count": 12, "field-name": "tweetid", "field-type": "STRING" }
+, { "count": 12, "field-name": "user", "field-type": "RECORD" }
+ ]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 2163093..94ae2f2 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -12,6 +12,11 @@
! See the License for the specific language governing permissions and
! limitations under the License.
!-->
+<!DOCTYPE test-suite [
+
+<!ENTITY RecordsQueries SYSTEM "queries/records/RecordsQueries.xml">
+
+]>
<test-suite
xmlns="urn:xml.testframework.asterix.ics.uci.edu"
ResultOffsetPath="results"
@@ -4343,65 +4348,7 @@
</test-case>
</test-group>
<test-group name="records">
- <test-case FilePath="records">
- <compilation-unit name="closed-record-constructor_01">
- <output-dir compare="Text">closed-record-constructor_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="closed-record-constructor_02">
- <output-dir compare="Text">closed-record-constructor_02</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="closed-record-constructor_03">
- <output-dir compare="Text">closed-record-constructor_03</output-dir>
- </compilation-unit>
- </test-case>
- -->
- <test-case FilePath="records">
- <compilation-unit name="expFieldName">
- <output-dir compare="Text">expFieldName</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="field-access-by-index_01">
- <output-dir compare="Text">field-access-by-index_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="field-access-on-open-field">
- <output-dir compare="Text">field-access-on-open-field</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="open-record-constructor_01">
- <output-dir compare="Text">open-record-constructor_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="open-record-constructor_02">
- <output-dir compare="Text">open-record-constructor_02</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="closed-closed-fieldname-conflict_issue173">
- <output-dir compare="Text">closed-closed-fieldname-conflict_issue173</output-dir>
- <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="open-closed-fieldname-conflict_issue173">
- <output-dir compare="Text">open-closed-fieldname-conflict_issue173</output-dir>
- <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="records">
- <compilation-unit name="open-open-fieldname-conflict_issue173">
- <output-dir compare="Text">open-open-fieldname-conflict_issue173</output-dir>
- <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
- </compilation-unit>
- </test-case>
+ &RecordsQueries;
</test-group>
<test-group name="scan">
<test-case FilePath="scan">
diff --git a/asterix-common/src/main/resources/schema/asterix-conf.xsd b/asterix-common/src/main/resources/schema/asterix-conf.xsd
index 6edfbf8..bed63be 100644
--- a/asterix-common/src/main/resources/schema/asterix-conf.xsd
+++ b/asterix-common/src/main/resources/schema/asterix-conf.xsd
@@ -1,88 +1,108 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!--
- ! Copyright 2009-2013 by The Regents of the University of California
- ! Licensed 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 from
- !
- ! 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.
- !-->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:mg="asterixconf" targetNamespace="asterixconf"
- elementFormDefault="qualified">
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:mg="asterixconf"
+ targetNamespace="asterixconf"
+ elementFormDefault="qualified">
- <!-- definition of simple types -->
+ <!-- definition of simple types -->
+ <xs:element
+ name="instanceName"
+ type="xs:string" />
+ <xs:element
+ name="version"
+ type="xs:string" />
+ <xs:element
+ name="metadataNode"
+ type="xs:string" />
+ <xs:element
+ name="coredumpPath"
+ type="xs:string" />
+ <xs:element
+ name="storeDirs"
+ type="xs:string" />
+ <xs:element
+ name="ncId"
+ type="xs:string" />
+ <xs:element
+ name="name"
+ type="xs:string" />
+ <xs:element
+ name="value"
+ type="xs:string" />
+ <xs:element
+ name="description"
+ type="xs:string" />
+ <xs:element
+ name="txnLogDirPath"
+ type="xs:string" />
+
+ <!-- definition of complex elements -->
+ <xs:element name="store">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="mg:ncId" />
+ <xs:element ref="mg:storeDirs" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="coredump">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="mg:ncId" />
+ <xs:element ref="mg:coredumpPath" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="transactionLogDir">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="mg:ncId" />
+ <xs:element ref="mg:txnLogDirPath" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="property">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="mg:name" />
+ <xs:element ref="mg:value" />
+ <xs:element ref="mg:description" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="instanceName" type="xs:string" />
- <xs:element name="version" type="xs:string"/>
- <xs:element name="metadataNode" type="xs:string" />
- <xs:element name="coredumpPath" type="xs:string" />
- <xs:element name="storeDirs" type="xs:string" />
- <xs:element name="ncId" type="xs:string" />
- <xs:element name="name" type="xs:string" />
- <xs:element name="value" type="xs:string" />
- <xs:element name="description" type="xs:string" />
- <xs:element name="txnLogDirPath" type="xs:string" />
+ <xs:element name="asterixConfiguration">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element
+ ref="mg:instanceName"
+ minOccurs="0" />
+ <xs:element
+ ref="mg:version"
+ minOccurs="0" />
+ <xs:element
+ ref="mg:metadataNode"
+ minOccurs="0" />
+ <xs:element
+ ref="mg:store"
+ maxOccurs="unbounded" />
+ <xs:element
+ ref="mg:coredump"
+ maxOccurs="unbounded" />
+ <xs:element
+ ref="mg:transactionLogDir"
+ maxOccurs="unbounded" />
+ <xs:element
+ ref="mg:property"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
-
- <!-- definition of complex elements -->
- <xs:element name="store">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="mg:ncId" />
- <xs:element ref="mg:storeDirs" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="coredump">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="mg:ncId" />
- <xs:element ref="mg:coredumpPath" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="transactionLogDir">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="mg:ncId" />
- <xs:element ref="mg:txnLogDirPath" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="property">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="mg:name" />
- <xs:element ref="mg:value" />
- <xs:element ref="mg:description" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-
- <xs:element name="asterixConfiguration">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="mg:instanceName" minOccurs="0" />
- <xs:element ref="mg:version" minOccurs="0" />
- <xs:element ref="mg:metadataNode" minOccurs="0" />
- <xs:element ref="mg:store" maxOccurs="unbounded" />
- <xs:element ref="mg:coredump" maxOccurs="unbounded" />
- <xs:element ref="mg:transactionLogDir" maxOccurs="unbounded" />
- <xs:element ref="mg:property" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
+</xs:schema>
diff --git a/asterix-common/src/main/resources/schema/yarn_cluster.xsd b/asterix-common/src/main/resources/schema/yarn_cluster.xsd
index 2aa76cf..62c6f9a 100644
--- a/asterix-common/src/main/resources/schema/yarn_cluster.xsd
+++ b/asterix-common/src/main/resources/schema/yarn_cluster.xsd
@@ -1,103 +1,179 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:cl="yarn_cluster" targetNamespace="yarn_cluster" elementFormDefault="qualified">
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:cl="yarn_cluster"
+ targetNamespace="yarn_cluster"
+ elementFormDefault="qualified">
<!-- definition of simple types -->
- <xs:element name="instance_name" type="xs:string" />
- <xs:element name="cluster_name" type="xs:string" />
- <xs:element name="log_dir" type="xs:string" />
- <xs:element name="txn_log_dir" type="xs:string" />
- <xs:element name="id" type="xs:string" />
- <xs:element name="client_ip" type="xs:string" />
- <xs:element name="cluster_ip" type="xs:string" />
- <xs:element name="key" type="xs:string" />
- <xs:element name="value" type="xs:string" />
- <xs:element name="store" type="xs:string" />
- <xs:element name="iodevices" type="xs:string" />
- <xs:element name="web_port" type="xs:string" />
- <xs:element name="client_port" type="xs:integer" />
- <xs:element name="cluster_port" type="xs:integer" />
- <xs:element name="http_port" type="xs:integer" />
- <xs:element name="debug_port" type="xs:integer" />
- <xs:element name="metadata_node" type="xs:string" />
- <xs:element name="cc_container_mem" type="xs:string" />
- <xs:element name="nc_container_mem" type="xs:string" />
+ <xs:element
+ name="instance_name"
+ type="xs:string" />
+ <xs:element
+ name="cluster_name"
+ type="xs:string" />
+ <xs:element
+ name="log_dir"
+ type="xs:string" />
+ <xs:element
+ name="txn_log_dir"
+ type="xs:string" />
+ <xs:element
+ name="id"
+ type="xs:string" />
+ <xs:element
+ name="client_ip"
+ type="xs:string" />
+ <xs:element
+ name="cluster_ip"
+ type="xs:string" />
+ <xs:element
+ name="key"
+ type="xs:string" />
+ <xs:element
+ name="value"
+ type="xs:string" />
+ <xs:element
+ name="store"
+ type="xs:string" />
+ <xs:element
+ name="iodevices"
+ type="xs:string" />
+ <xs:element
+ name="web_port"
+ type="xs:string" />
+ <xs:element
+ name="client_port"
+ type="xs:integer" />
+ <xs:element
+ name="cluster_port"
+ type="xs:integer" />
+ <xs:element
+ name="http_port"
+ type="xs:integer" />
+ <xs:element
+ name="debug_port"
+ type="xs:integer" />
+ <xs:element
+ name="metadata_node"
+ type="xs:string" />
+ <xs:element
+ name="cc_container_mem"
+ type="xs:string" />
+ <xs:element
+ name="nc_container_mem"
+ type="xs:string" />
<!-- definition of complex elements -->
- <xs:element name="master_node">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="cl:id" />
- <xs:element ref="cl:client_ip" />
- <xs:element ref="cl:cluster_ip" />
- <xs:element ref="cl:log_dir" minOccurs="0" />
- <xs:element ref="cl:client_port" />
- <xs:element ref="cl:cluster_port" />
- <xs:element ref="cl:http_port" />
- <xs:element ref="cl:debug_port" minOccurs="0" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="master_node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="cl:id" />
+ <xs:element ref="cl:client_ip" />
+ <xs:element ref="cl:cluster_ip" />
+ <xs:element
+ ref="cl:log_dir"
+ minOccurs="0" />
+ <xs:element ref="cl:client_port" />
+ <xs:element ref="cl:cluster_port" />
+ <xs:element ref="cl:http_port" />
+ <xs:element
+ ref="cl:debug_port"
+ minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="property">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="cl:key" />
- <xs:element ref="cl:value" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="property">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="cl:key" />
+ <xs:element ref="cl:value" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="env">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="cl:property" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="env">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element
+ ref="cl:property"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="node">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="cl:id" />
- <xs:element ref="cl:cluster_ip" />
- <xs:element ref="cl:log_dir" minOccurs="0" />
- <xs:element ref="cl:txn_log_dir" minOccurs="0" />
- <xs:element ref="cl:store" minOccurs="0" />
- <xs:element ref="cl:iodevices" minOccurs="0" />
- <xs:element ref="cl:debug_port" minOccurs="0" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="cl:id" />
+ <xs:element ref="cl:cluster_ip" />
+ <xs:element
+ ref="cl:log_dir"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:txn_log_dir"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:store"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:iodevices"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:debug_port"
+ minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="substitute_nodes">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="cl:node" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="substitute_nodes">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element
+ ref="cl:node"
+ maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="cluster">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="cl:instance_name" />
- <xs:element ref="cl:cluster_name" />
- <xs:element ref="cl:cc_container_mem" minOccurs="0" />
- <xs:element ref="cl:nc_container_mem" minOccurs="0" />
- <xs:element ref="cl:env" minOccurs="0" />
- <xs:element ref="cl:log_dir" minOccurs="0" />
- <xs:element ref="cl:txn_log_dir" minOccurs="0" />
- <xs:element ref="cl:store" minOccurs="0" />
- <xs:element ref="cl:iodevices" minOccurs="0" />
- <xs:element ref="cl:metadata_node" />
- <xs:element ref="cl:master_node" />
- <xs:element ref="cl:node" maxOccurs="unbounded" />
- <xs:element ref="cl:substitute_nodes" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="cluster">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="cl:instance_name" />
+ <xs:element ref="cl:cluster_name" />
+ <xs:element
+ ref="cl:cc_container_mem"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:nc_container_mem"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:env"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:log_dir"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:txn_log_dir"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:store"
+ minOccurs="0" />
+ <xs:element
+ ref="cl:iodevices"
+ minOccurs="0" />
+ <xs:element ref="cl:metadata_node" />
+ <xs:element ref="cl:master_node" />
+ <xs:element
+ ref="cl:node"
+ maxOccurs="unbounded" />
+ <xs:element ref="cl:substitute_nodes" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
diff --git a/asterix-doc/src/site/markdown/aql/functions.md b/asterix-doc/src/site/markdown/aql/functions.md
index a5f7961..fd00d11 100644
--- a/asterix-doc/src/site/markdown/aql/functions.md
+++ b/asterix-doc/src/site/markdown/aql/functions.md
@@ -9,6 +9,7 @@
* [Similarity Functions](#SimilarityFunctions)
* [Tokenizing Functions](#TokenizingFunctions)
* [Temporal Functions](#TemporalFunctions)
+* [Record Functions](#RecordFunctions)
* [Other Functions](#OtherFunctions)
Asterix provides various classes of functions to support operations on numeric, string, spatial, and temporal data. This document explains how to use these functions.
@@ -2221,6 +2222,66 @@
"datetimebins": [ interval-datetime("1800-01-01T00:00:00.000Z, 1900-01-01T00:00:00.000Z"), interval-datetime("1900-01-01T00:00:00.000Z, 2000-01-01T00:00:00.000Z"), interval-datetime("2000-01-01T00:00:00.000Z, 2100-01-01T00:00:00.000Z") ] }
+## <a id="RecordFunctions">Record Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font> ##
+
+
+### get-record-fields ###
+ * Syntax:
+
+ get-record-fields(record_expression)
+
+ * Access the record field names, type and open status for a given record.
+ * Arguments:
+ * `record_expression` : a record value.
+ * Return Value:
+ * An order list of `record` values that include the field-name `string`, field-type `string`, is-open `boolean` and optional nested `orderedList` for the values of a nested record.
+
+ * Example:
+
+ let $r1 := {"id": 1,
+ "project": "AsterixDB",
+ "address": {"city": "Irvine", "state": "CA"},
+ "related": ["Hivestrix", "Preglix", "Apache VXQuery"] }
+ return get-record-fields($r1)
+
+ * The expected result is:
+
+ [ { "field-name": "id", "field-type": "INT64", "is-open": false },
+ { "field-name": "project", "field-type": "STRING", "is-open": false },
+ { "field-name": "address", "field-type": "RECORD", "is-open": false, "nested": [
+ { "field-name": "city", "field-type": "STRING", "is-open": false },
+ { "field-name": "state", "field-type": "STRING", "is-open": false } ] },
+ { "field-name": "related", "field-type": "ORDEREDLIST", "is-open": false, "list": [
+ { "field-type": "STRING" },
+ { "field-type": "STRING" },
+ { "field-type": "STRING" } ] } ]
+
+ ]
+### get-record-field-value ###
+ * Syntax:
+
+ get-record-field-value(record_expression, string_expression)
+
+ * Access the field name given in the `string_expression` from the `record_expression`.
+ * Arguments:
+ * `record_expression` : A `record` value.
+ * `string_expression` : A `string` representing the top level field name.
+ * Return Value:
+ * An `any` value saved in the designated field of the record.
+
+ * Example:
+
+ let $r1 := {"id": 1,
+ "project": "AsterixDB",
+ "address": {"city": "Irvine", "state": "CA"},
+ "related": ["Hivestrix", "Preglix", "Apache VXQuery"] }
+ return get-record-field-value($r1, "project")
+
+ * The expected result is:
+
+ "AsterixDB"
+
+
## <a id="OtherFunctions">Other Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font> ##
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/indexing/input/AbstractHDFSReader.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/indexing/input/AbstractHDFSReader.java
index b6bc2c0..1027517 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/indexing/input/AbstractHDFSReader.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/indexing/input/AbstractHDFSReader.java
@@ -24,38 +24,40 @@
* an abstract class to be used for reading hdfs based datasets one record at a time <- used for indexing->
*/
@SuppressWarnings("deprecation")
-public abstract class AbstractHDFSReader extends InputStream{
+public abstract class AbstractHDFSReader extends InputStream {
/***
* This function should be called once to do initial setup before starting to read records
+ *
* @return true if ready for reading
*/
abstract public boolean initialize() throws Exception;
-
+
/***
* @return the next object read or null if reached end of stream
*/
abstract public Object readNext() throws Exception;
-
+
/**
* @return the file name of the current filesplit being read
- * @throws Exception in case of end of records is reached
+ * @throws Exception
+ * in case of end of records is reached
*/
abstract public String getFileName() throws Exception;
-
+
/**
* @return return the reader position of last record read
- * @throws Exception in case of end of records is reached
+ * @throws Exception
+ * in case of end of records is reached
*/
abstract public long getReaderPosition() throws Exception;
-
+
/**
- *
* @return the file number of the file being read
* @throws Exception
*/
abstract public int getFileNumber() throws Exception;
-
+
protected Reporter getReporter() {
Reporter reporter = new Reporter() {
@@ -70,8 +72,7 @@
}
@Override
- public InputSplit getInputSplit()
- throws UnsupportedOperationException {
+ public InputSplit getInputSplit() throws UnsupportedOperationException {
return null;
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/JavaFunctionHelper.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/JavaFunctionHelper.java
index ed6cc23..e2e694a 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/JavaFunctionHelper.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/JavaFunctionHelper.java
@@ -24,8 +24,8 @@
import edu.uci.ics.asterix.external.library.java.JTypeTag;
import edu.uci.ics.asterix.om.functions.IExternalFunctionInfo;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.PointableAllocator;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -88,13 +88,13 @@
case RECORD:
pointable = pointableAllocator.allocateRecordValue(type);
pointable.set(valueReference);
- jObject = pointableVisitor.visit((ARecordPointable) pointable, getTypeInfo(index, type));
+ jObject = pointableVisitor.visit((ARecordVisitablePointable) pointable, getTypeInfo(index, type));
break;
case ORDEREDLIST:
case UNORDEREDLIST:
pointable = pointableAllocator.allocateListValue(type);
pointable.set(valueReference);
- jObject = pointableVisitor.visit((AListPointable) pointable, getTypeInfo(index, type));
+ jObject = pointableVisitor.visit((AListVisitablePointable) pointable, getTypeInfo(index, type));
break;
case ANY:
throw new IllegalStateException("Cannot handle a function argument of type " + type.getTypeTag());
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJListAccessor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJListAccessor.java
index f1ae883..71f6ff2 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJListAccessor.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJListAccessor.java
@@ -14,13 +14,13 @@
*/
package edu.uci.ics.asterix.external.library.java;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.container.IObjectPool;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
public interface IJListAccessor {
- IJObject access(AListPointable pointable, IObjectPool<IJObject, IAType> objectPool, IAType listType,
+ IJObject access(AListVisitablePointable pointable, IObjectPool<IJObject, IAType> objectPool, IAType listType,
JObjectPointableVisitor pointableVisitor) throws HyracksDataException;
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJRecordAccessor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJRecordAccessor.java
index 54b8726..1e3d692 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJRecordAccessor.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJRecordAccessor.java
@@ -15,7 +15,7 @@
package edu.uci.ics.asterix.external.library.java;
import edu.uci.ics.asterix.external.library.java.JObjects.JRecord;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.container.IObjectPool;
@@ -23,7 +23,7 @@
public interface IJRecordAccessor {
- public JRecord access(ARecordPointable pointable, IObjectPool<IJObject, IAType> objectPool, ARecordType recordType,
+ public JRecord access(ARecordVisitablePointable pointable, IObjectPool<IJObject, IAType> objectPool, ARecordType recordType,
JObjectPointableVisitor pointableVisitor) throws HyracksDataException;
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectAccessors.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectAccessors.java
index 084dd8e..c2e4cf3 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectAccessors.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectAccessors.java
@@ -16,7 +16,6 @@
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
-import java.io.UnsupportedEncodingException;
import java.util.LinkedHashMap;
import java.util.List;
@@ -72,8 +71,8 @@
import edu.uci.ics.asterix.om.base.APolygon;
import edu.uci.ics.asterix.om.base.ARectangle;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -448,14 +447,14 @@
}
@Override
- public JRecord access(ARecordPointable pointable, IObjectPool<IJObject, IAType> objectPool,
+ public JRecord access(ARecordVisitablePointable pointable, IObjectPool<IJObject, IAType> objectPool,
ARecordType recordType, JObjectPointableVisitor pointableVisitor) throws HyracksDataException {
try {
jRecord.reset();
} catch (AlgebricksException e) {
throw new HyracksDataException(e);
}
- ARecordPointable recordPointable = (ARecordPointable) pointable;
+ ARecordVisitablePointable recordPointable = (ARecordVisitablePointable) pointable;
List<IVisitablePointable> fieldPointables = recordPointable.getFieldValues();
List<IVisitablePointable> fieldTypeTags = recordPointable.getFieldTypeTags();
List<IVisitablePointable> fieldNames = recordPointable.getFieldNames();
@@ -473,7 +472,7 @@
typeInfo.reset(fieldType, typeTag);
switch (typeTag) {
case RECORD:
- fieldObject = pointableVisitor.visit((ARecordPointable) fieldPointable, typeInfo);
+ fieldObject = pointableVisitor.visit((ARecordVisitablePointable) fieldPointable, typeInfo);
break;
case ORDEREDLIST:
case UNORDEREDLIST:
@@ -481,7 +480,7 @@
// value is null
fieldObject = null;
} else {
- fieldObject = pointableVisitor.visit((AListPointable) fieldPointable, typeInfo);
+ fieldObject = pointableVisitor.visit((AListVisitablePointable) fieldPointable, typeInfo);
}
break;
case ANY:
@@ -530,7 +529,7 @@
}
@Override
- public IJObject access(AListPointable pointable, IObjectPool<IJObject, IAType> objectPool, IAType listType,
+ public IJObject access(AListVisitablePointable pointable, IObjectPool<IJObject, IAType> objectPool, IAType listType,
JObjectPointableVisitor pointableVisitor) throws HyracksDataException {
List<IVisitablePointable> items = pointable.getItems();
List<IVisitablePointable> itemTags = pointable.getItemTags();
@@ -546,11 +545,11 @@
typeInfo.reset(listType.getType(), listType.getTypeTag());
switch (itemTypeTag) {
case RECORD:
- listItem = pointableVisitor.visit((ARecordPointable) itemPointable, typeInfo);
+ listItem = pointableVisitor.visit((ARecordVisitablePointable) itemPointable, typeInfo);
break;
case UNORDEREDLIST:
case ORDEREDLIST:
- listItem = pointableVisitor.visit((AListPointable) itemPointable, typeInfo);
+ listItem = pointableVisitor.visit((AListVisitablePointable) itemPointable, typeInfo);
break;
case ANY:
throw new IllegalArgumentException("Cannot parse list item of type "
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectPointableVisitor.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectPointableVisitor.java
index cceec85..20d7c28 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectPointableVisitor.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/JObjectPointableVisitor.java
@@ -22,8 +22,8 @@
import edu.uci.ics.asterix.external.library.java.JObjectAccessors.JListAccessor;
import edu.uci.ics.asterix.external.library.java.JObjectAccessors.JRecordAccessor;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -37,7 +37,7 @@
private final Map<IVisitablePointable, IJListAccessor> laccessorToPrinter = new HashMap<IVisitablePointable, IJListAccessor>();
@Override
- public IJObject visit(AListPointable accessor, TypeInfo arg) throws AsterixException {
+ public IJObject visit(AListVisitablePointable accessor, TypeInfo arg) throws AsterixException {
IJObject result = null;
IJListAccessor jListAccessor = laccessorToPrinter.get(accessor);
if (jListAccessor == null) {
@@ -53,7 +53,7 @@
}
@Override
- public IJObject visit(ARecordPointable accessor, TypeInfo arg) throws AsterixException {
+ public IJObject visit(ARecordVisitablePointable accessor, TypeInfo arg) throws AsterixException {
IJObject result = null;
IJRecordAccessor jRecordAccessor = raccessorToJObject.get(accessor);
if (jRecordAccessor == null) {
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/PKGeneratingAdapter.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/PKGeneratingAdapter.java
index 862092a..9f78b37 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/PKGeneratingAdapter.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/PKGeneratingAdapter.java
@@ -21,7 +21,7 @@
import edu.uci.ics.asterix.common.feeds.api.IDatasourceAdapter;
import edu.uci.ics.asterix.om.base.AMutableUUID;
import edu.uci.ics.asterix.om.base.AUUID;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.PointableAllocator;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -75,7 +75,7 @@
private final byte AUUIDTag = ATypeTag.UUID.serialize();
private final byte[] serializedUUID = new byte[16];
private final PointableAllocator pa = new PointableAllocator();
- private final ARecordPointable recordPointable;
+ private final ARecordVisitablePointable recordPointable;
private final IAType[] outClosedTypes;
private final RecordBuilder recBuilder;
@@ -85,7 +85,7 @@
this.outRecType = outRecType;
this.tb = new ArrayTupleBuilder(2);
this.recBuilder = new RecordBuilder();
- this.recordPointable = (ARecordPointable) pa.allocateRecordValue(inRecType);
+ this.recordPointable = (ARecordVisitablePointable) pa.allocateRecordValue(inRecType);
this.outClosedTypes = outRecType.getFieldTypes();
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/AbvsBuilderFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/AbvsBuilderFactory.java
new file mode 100644
index 0000000..9d0e434
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/AbvsBuilderFactory.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.builders;
+
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+import edu.uci.ics.hyracks.data.std.api.IMutableValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+
+public class AbvsBuilderFactory implements IObjectFactory<IMutableValueStorage, String> {
+
+ @Override
+ public IMutableValueStorage create(String type) {
+ return new ArrayBackedValueStorage();
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/ListBuilderFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/ListBuilderFactory.java
new file mode 100644
index 0000000..da098e5
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/ListBuilderFactory.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.builders;
+
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+
+public class ListBuilderFactory implements IObjectFactory<IAsterixListBuilder, String> {
+
+ @Override
+ public IAsterixListBuilder create(String type) {
+ if (type.equals("ordered")) {
+ return new OrderedListBuilder();
+ } else {
+ return new UnorderedListBuilder();
+ }
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilderFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilderFactory.java
new file mode 100644
index 0000000..55ab2d0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilderFactory.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.builders;
+
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+
+public class RecordBuilderFactory implements IObjectFactory<IARecordBuilder, String> {
+
+ @Override
+ public IARecordBuilder create(String type) {
+ return new RecordBuilder();
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
index 545cfb2..b6eca48 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
@@ -36,14 +36,8 @@
@Override
public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
- long chrononTime = AInt32SerializerDeserializer.getInt(b, s + 1) * CHRONON_OF_DAY;
-
ps.print("date(\"");
- try {
- gCalInstance.getExtendStringRepUntilField(chrononTime, 0, ps, Fields.YEAR, Fields.DAY, false);
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
+ printString(b, s, l, ps);
ps.print("\")");
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
index cd7a2fb..bede764 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
@@ -35,16 +35,8 @@
@Override
public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
- long chrononTime = AInt64SerializerDeserializer.getLong(b, s + 1);
-
ps.print("datetime(\"");
-
- try {
- gCalInstance.getExtendStringRepUntilField(chrononTime, 0, ps, Fields.YEAR, Fields.MILLISECOND, true);
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
-
+ printString(b, s, l, ps);
ps.print("\")");
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
index 558c49f..99e076a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
@@ -30,7 +30,6 @@
@Override
public void init() throws AlgebricksException {
- // TODO Auto-generated method stub
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java
index 5a96e52..aeb325f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AObjectPrinter.java
@@ -115,6 +115,10 @@
APolygonPrinter.INSTANCE.print(b, s, l, ps);
break;
}
+ case RECTANGLE: {
+ ARectanglePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
case CIRCLE: {
ACirclePrinter.INSTANCE.print(b, s, l, ps);
break;
@@ -150,9 +154,20 @@
ShortWithoutTypeInfoPrinter.INSTANCE.print(b, s, l, ps);
break;
}
- default: {
+ case ANY:
+ case BITARRAY:
+ case ENUM:
+ case SPARSERECORD:
+ case SYSTEM_NULL:
+ case TYPE:
+ case UINT16:
+ case UINT32:
+ case UINT64:
+ case UINT8:
+ case UNION:
+ case UUID_STRING:
+ // These are internal types and do not need a printer.
throw new NotImplementedException("No printer for type " + typeTag);
- }
}
}
}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
index 618b17a..8a2e179 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
@@ -35,16 +35,8 @@
@Override
public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
- int time = AInt32SerializerDeserializer.getInt(b, s + 1);
-
ps.print("time(\"");
-
- try {
- gCalInstance.getExtendStringRepUntilField(time, 0, ps, Fields.HOUR, Fields.MILLISECOND, true);
- } catch (IOException e) {
- throw new AlgebricksException(e);
- }
-
+ printString(b,s,l, ps);
ps.print("\")");
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/PrintTools.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/PrintTools.java
index e4b8441..53cbe6d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/PrintTools.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/PrintTools.java
@@ -14,12 +14,11 @@
*/
package edu.uci.ics.asterix.dataflow.data.nontagged.printers;
-import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-
-import javax.xml.bind.DatatypeConverter;
import java.io.IOException;
import java.io.OutputStream;
+import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
+
public class PrintTools {
public static enum CASE {
LOWER_CASE,
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADatePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADatePrinter.java
index 37af669..a63b0bc 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADatePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADatePrinter.java
@@ -16,7 +16,6 @@
import java.io.PrintStream;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADateTimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADateTimePrinter.java
index e90c586..1cbafcb 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADateTimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/ADateTimePrinter.java
@@ -16,7 +16,6 @@
import java.io.PrintStream;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AIntervalPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AIntervalPrinter.java
index c1793c9..7080b16 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AIntervalPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AIntervalPrinter.java
@@ -16,8 +16,6 @@
import java.io.PrintStream;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
-import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AObjectPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AObjectPrinter.java
index dbf6729..8b543da 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AObjectPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/csv/AObjectPrinter.java
@@ -93,6 +93,9 @@
ADayTimeDurationPrinter.INSTANCE.print(b, s, l, ps);
break;
}
+ case INTERVAL:
+ AIntervalPrinter.INSTANCE.print(b, s, l, ps);
+ break;
case POINT: {
APointPrinter.INSTANCE.print(b, s, l, ps);
break;
@@ -113,6 +116,9 @@
ACirclePrinter.INSTANCE.print(b, s, l, ps);
break;
}
+ case RECTANGLE:
+ ARectanglePrinter.INSTANCE.print(b, s, l, ps);
+ break;
case STRING: {
AStringPrinter.INSTANCE.print(b, s, l, ps);
break;
@@ -122,9 +128,24 @@
recordPrinter.print(b, s, l, ps);
break;
}
- default: {
+ case ANY:
+ case BINARY:
+ case BITARRAY:
+ case ENUM:
+ case ORDEREDLIST:
+ case SHORTWITHOUTTYPEINFO:
+ case SPARSERECORD:
+ case SYSTEM_NULL:
+ case TYPE:
+ case UINT16:
+ case UINT32:
+ case UINT64:
+ case UINT8:
+ case UNION:
+ case UNORDEREDLIST:
+ case UUID:
+ case UUID_STRING:
throw new NotImplementedException("No printer for type " + typeTag);
- }
}
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADayTimeDurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADayTimeDurationPrinter.java
index 50f994f..bd5c69c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADayTimeDurationPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADayTimeDurationPrinter.java
@@ -26,7 +26,6 @@
@Override
public void init() throws AlgebricksException {
- // TODO Auto-generated method stub
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java
index 01850bc..58e83ec 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java
@@ -38,7 +38,7 @@
ps.print("{ \"duration\": { ");
ps.print("\"months\": ");
ps.print(months);
- ps.print("\"millis\": ");
+ ps.print(", \"millis\": ");
ps.print(milliseconds);
ps.print("} }");
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java
index 7c38a34..85cbcfb 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java
@@ -96,7 +96,11 @@
ADayTimeDurationPrinter.INSTANCE.print(b, s, l, ps);
break;
}
- case POINT: {
+ case INTERVAL: {
+ AIntervalPrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
+ case POINT: {
APointPrinter.INSTANCE.print(b, s, l, ps);
break;
}
@@ -116,6 +120,10 @@
ACirclePrinter.INSTANCE.print(b, s, l, ps);
break;
}
+ case RECTANGLE: {
+ ARectanglePrinter.INSTANCE.print(b, s, l, ps);
+ break;
+ }
case STRING: {
AStringPrinter.INSTANCE.print(b, s, l, ps);
break;
@@ -139,9 +147,21 @@
unorderedListPrinter.print(b, s, l, ps);
break;
}
- default: {
+ case ANY:
+ case BITARRAY:
+ case ENUM:
+ case SHORTWITHOUTTYPEINFO:
+ case SPARSERECORD:
+ case SYSTEM_NULL:
+ case TYPE:
+ case UINT16:
+ case UINT32:
+ case UINT64:
+ case UINT8:
+ case UNION:
+ case UUID:
+ case UUID_STRING:
throw new NotImplementedException("No printer for type " + typeTag);
- }
}
}
}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
index 371aa5d..2f120cc 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
@@ -28,6 +28,7 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.AInt32PrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.AInt64PrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.AInt8PrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.AIntervalPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.ALinePrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.ANullPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.ANullableFieldPrinterFactory;
@@ -62,8 +63,6 @@
if (aqlType != null) {
switch (aqlType.getTypeTag()) {
- // case ANYTYPE:
- // return AAnyTypePrinterFactory.INSTANCE;
case INT8:
return AInt8PrinterFactory.INSTANCE;
case INT16:
@@ -92,6 +91,8 @@
return AYearMonthDurationPrinterFactory.INSTANCE;
case DAYTIMEDURATION:
return ADayTimeDurationPrinterFactory.INSTANCE;
+ case INTERVAL:
+ return AIntervalPrinterFactory.INSTANCE;
case POINT:
return APointPrinterFactory.INSTANCE;
case POINT3D:
@@ -123,6 +124,20 @@
}
case SHORTWITHOUTTYPEINFO:
return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
+ case ANY:
+ case BINARY:
+ case BITARRAY:
+ case ENUM:
+ case SPARSERECORD:
+ case SYSTEM_NULL:
+ case TYPE:
+ case UINT16:
+ case UINT32:
+ case UINT64:
+ case UINT8:
+ case UUID_STRING:
+ // These types are not intended to be printed to the user.
+ break;
}
}
return AObjectPrinterFactory.INSTANCE;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java
index 9ae9dbc..15bab45 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java
@@ -29,6 +29,7 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt32PrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt64PrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt8PrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AIntervalPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ALinePrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ANullPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ANullableFieldPrinterFactory;
@@ -67,8 +68,6 @@
if (aqlType != null) {
switch (aqlType.getTypeTag()) {
- // case ANYTYPE:
- // return AAnyTypePrinterFactory.INSTANCE;
case INT8:
return AInt8PrinterFactory.INSTANCE;
case INT16:
@@ -97,6 +96,8 @@
return AYearMonthDurationPrinterFactory.INSTANCE;
case DAYTIMEDURATION:
return ADayTimeDurationPrinterFactory.INSTANCE;
+ case INTERVAL:
+ return AIntervalPrinterFactory.INSTANCE;
case POINT:
return APointPrinterFactory.INSTANCE;
case POINT3D:
@@ -130,9 +131,21 @@
}
case SHORTWITHOUTTYPEINFO:
return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
+ case ANY:
+ case BITARRAY:
+ case ENUM:
+ case SPARSERECORD:
+ case SYSTEM_NULL:
+ case TYPE:
+ case UINT16:
+ case UINT32:
+ case UINT64:
+ case UINT8:
+ case UUID_STRING:
+ // These types are not intended to be printed to the user.
+ break;
}
}
return AObjectPrinterFactory.INSTANCE;
-
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPrinterFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPrinterFactoryProvider.java
index bf941d0..24a0561 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPrinterFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPrinterFactoryProvider.java
@@ -19,6 +19,7 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ACirclePrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADatePrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADateTimePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADayTimeDurationPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADoublePrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADurationPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AFloatPrinterFactory;
@@ -42,6 +43,7 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AUUIDPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AUnionPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AUnorderedlistPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AYearMonthDurationPrinterFactory;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ShortWithoutTypeInfoPrinterFactory;
import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.ARecordType;
@@ -66,8 +68,6 @@
if (aqlType != null) {
switch (aqlType.getTypeTag()) {
- // case ANYTYPE:
- // return AAnyTypePrinterFactory.INSTANCE;
case INT8:
return AInt8PrinterFactory.INSTANCE;
case INT16:
@@ -92,6 +92,10 @@
return ADateTimePrinterFactory.INSTANCE;
case DURATION:
return ADurationPrinterFactory.INSTANCE;
+ case DAYTIMEDURATION:
+ return ADayTimeDurationPrinterFactory.INSTANCE;
+ case YEARMONTHDURATION:
+ return AYearMonthDurationPrinterFactory.INSTANCE;
case INTERVAL:
return AIntervalPrinterFactory.INSTANCE;
case POINT:
@@ -127,6 +131,19 @@
}
case SHORTWITHOUTTYPEINFO:
return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
+ case ANY:
+ case BITARRAY:
+ case ENUM:
+ case SPARSERECORD:
+ case SYSTEM_NULL:
+ case TYPE:
+ case UINT16:
+ case UINT32:
+ case UINT64:
+ case UINT8:
+ case UUID_STRING:
+ // These types are not intended to be printed to the user.
+ break;
}
}
return AObjectPrinterFactory.INSTANCE;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
index fa99064..560156c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
@@ -38,6 +38,7 @@
import edu.uci.ics.asterix.om.typecomputer.impl.AStringTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.ATimeTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.AUUIDTypeComputer;
+import edu.uci.ics.asterix.om.typecomputer.impl.AnyTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.BinaryBooleanOrNullFunctionTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.BinaryStringBoolOrNullTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.BinaryStringStringOrNullTypeComputer;
@@ -96,6 +97,7 @@
import edu.uci.ics.asterix.om.typecomputer.impl.QuadStringStringOrNullTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.RecordMergeTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.ScalarVersionOfAggregateResultType;
+import edu.uci.ics.asterix.om.typecomputer.impl.SubsetCollectionTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.Substring2TypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.SubstringTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.TripleStringBoolOrNullTypeComputer;
@@ -105,22 +107,12 @@
import edu.uci.ics.asterix.om.typecomputer.impl.UnaryStringInt64OrNullTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.UnaryStringOrNullTypeComputer;
import edu.uci.ics.asterix.om.typecomputer.impl.UnorderedListConstructorResultType;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.types.hierachy.ATypeHierarchy;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AggregateFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
public class AsterixBuiltinFunctions {
@@ -191,10 +183,14 @@
"field-access-by-name", 2);
public final static FunctionIdentifier FIELD_ACCESS_NESTED = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"field-access-nested", 2);
+ public final static FunctionIdentifier GET_RECORD_FIELDS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+ "get-record-fields", 1);
+ public final static FunctionIdentifier GET_RECORD_FIELD_VALUE = new FunctionIdentifier(
+ FunctionConstants.ASTERIX_NS, "get-record-field-value", 2);
+ // numeric
public final static FunctionIdentifier NUMERIC_UNARY_MINUS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"numeric-unary-minus", 1);
-
public final static FunctionIdentifier NUMERIC_SUBTRACT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"numeric-subtract", 2);
public final static FunctionIdentifier NUMERIC_MULTIPLY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
@@ -206,7 +202,6 @@
public final static FunctionIdentifier NUMERIC_IDIV = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"numeric-idiv", 2);
public final static FunctionIdentifier CARET = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "caret", 2);
-
public final static FunctionIdentifier NUMERIC_ABS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "abs", 1);
public final static FunctionIdentifier NUMERIC_CEILING = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
"ceiling", 1);
@@ -754,8 +749,6 @@
addFunction(BOOLEAN_CONSTRUCTOR, UnaryBooleanOrNullFunctionTypeComputer.INSTANCE, true);
addPrivateFunction(CARET, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE, true);
addFunction(CIRCLE_CONSTRUCTOR, OptionalACircleTypeComputer.INSTANCE, true);
- addPrivateFunction(RECORD_MERGE, RecordMergeTypeComputer.INSTANCE, true);
- addPrivateFunction(CLOSED_RECORD_CONSTRUCTOR, ClosedRecordConstructorResultType.INSTANCE, true);
addPrivateFunction(CONCAT_NON_NULL, ConcatNonNullTypeComputer.INSTANCE, true);
addFunction(CONTAINS, ABooleanTypeComputer.INSTANCE, true);
@@ -780,19 +773,11 @@
addFunction(EDIT_DISTANCE_CHECK, OrderedListOfAnyTypeComputer.INSTANCE, true);
addPrivateFunction(EDIT_DISTANCE_STRING_IS_FILTERABLE, ABooleanTypeComputer.INSTANCE, true);
addPrivateFunction(EDIT_DISTANCE_LIST_IS_FILTERABLE, ABooleanTypeComputer.INSTANCE, true);
- addPrivateFunction(EMBED_TYPE, new IResultTypeComputer() {
- @Override
- public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
- IMetadataProvider<?, ?> mp) throws AlgebricksException {
- return (IAType) BuiltinType.ANY;
- }
- }, true);
+ addPrivateFunction(EMBED_TYPE, AnyTypeComputer.INSTANCE, true);
addPrivateFunction(EMPTY_STREAM, ABooleanTypeComputer.INSTANCE, true);
addFunction(ENDS_WITH, ABooleanTypeComputer.INSTANCE, true);
// add(FIELD_ACCESS, NonTaggedFieldAccessByNameResultType.INSTANCE);
- addPrivateFunction(FIELD_ACCESS_BY_INDEX, FieldAccessByIndexResultType.INSTANCE, true);
- addPrivateFunction(FIELD_ACCESS_NESTED, FieldAccessNestedResultType.INSTANCE, true);
- addPrivateFunction(FIELD_ACCESS_BY_NAME, NonTaggedFieldAccessByNameResultType.INSTANCE, true);
+
addFunction(FLOAT_CONSTRUCTOR, OptionalAFloatTypeComputer.INSTANCE, true);
addPrivateFunction(FUZZY_EQ, BinaryBooleanOrNullFunctionTypeComputer.INSTANCE, true);
addPrivateFunction(GET_HANDLE, null, true); // TODO
@@ -802,14 +787,7 @@
addPrivateFunction(GRAM_TOKENS, OrderedListOfAStringTypeComputer.INSTANCE, true);
addPrivateFunction(HASHED_GRAM_TOKENS, OrderedListOfAInt32TypeComputer.INSTANCE, true);
addPrivateFunction(HASHED_WORD_TOKENS, OrderedListOfAInt32TypeComputer.INSTANCE, true);
- addPrivateFunction(INDEX_SEARCH, new IResultTypeComputer() {
-
- @Override
- public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
- IMetadataProvider<?, ?> mp) throws AlgebricksException {
- return BuiltinType.ANY; // TODO
- }
- }, true);
+ addPrivateFunction(INDEX_SEARCH, AnyTypeComputer.INSTANCE, true);
addFunction(INT8_CONSTRUCTOR, OptionalAInt8TypeComputer.INSTANCE, true);
addFunction(INT16_CONSTRUCTOR, OptionalAInt16TypeComputer.INSTANCE, true);
addFunction(INT32_CONSTRUCTOR, OptionalAInt32TypeComputer.INSTANCE, true);
@@ -827,13 +805,13 @@
addPrivateFunction(LOCAL_MIN, NonTaggedMinMaxAggTypeComputer.INSTANCE, true);
addPrivateFunction(NON_EMPTY_STREAM, ABooleanTypeComputer.INSTANCE, true);
addFunction(NULL_CONSTRUCTOR, ANullTypeComputer.INSTANCE, true);
+
addPrivateFunction(NUMERIC_UNARY_MINUS, NonTaggedUnaryMinusTypeComputer.INSTANCE, true);
addPrivateFunction(NUMERIC_SUBTRACT, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE, true);
addPrivateFunction(NUMERIC_MULTIPLY, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE, true);
addPrivateFunction(NUMERIC_DIVIDE, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE, true);
addPrivateFunction(NUMERIC_MOD, NonTaggedNumericAddSubMulDivTypeComputer.INSTANCE, true);
addPrivateFunction(NUMERIC_IDIV, AInt64TypeComputer.INSTANCE, true);
-
addFunction(NUMERIC_ABS, NonTaggedNumericUnaryFunctionTypeComputer.INSTANCE, true);
addFunction(NUMERIC_CEILING, NonTaggedNumericUnaryFunctionTypeComputer.INSTANCE, true);
addFunction(NUMERIC_FLOOR, NonTaggedNumericUnaryFunctionTypeComputer.INSTANCE, true);
@@ -868,7 +846,6 @@
addPrivateFunction(STRING_EQUAL, BinaryStringBoolOrNullTypeComputer.INSTANCE, true);
addFunction(STRING_JOIN, AStringTypeComputer.INSTANCE, true);
- addPrivateFunction(OPEN_RECORD_CONSTRUCTOR, OpenRecordConstructorResultType.INSTANCE, true);
addPrivateFunction(ORDERED_LIST_CONSTRUCTOR, OrderedListConstructorResultType.INSTANCE, true);
addFunction(POINT_CONSTRUCTOR, OptionalAPointTypeComputer.INSTANCE, true);
addFunction(POINT3D_CONSTRUCTOR, OptionalAPoint3DTypeComputer.INSTANCE, true);
@@ -940,45 +917,7 @@
addFunction(BINARY_HEX_CONSTRUCTOR, OptionalABinaryTypeComputer.INSTANCE, true);
addFunction(BINARY_BASE64_CONSTRUCTOR, OptionalABinaryTypeComputer.INSTANCE, true);
- addPrivateFunction(UNION, UnorderedListConstructorResultType.INSTANCE, true);
-
- addPrivateFunction(SUBSET_COLLECTION, new IResultTypeComputer() {
-
- @Override
- public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
- IMetadataProvider<?, ?> mp) throws AlgebricksException {
- AbstractFunctionCallExpression fun = (AbstractFunctionCallExpression) expression;
- IAType t;
- try {
- t = (IAType) env.getType(fun.getArguments().get(0).getValue());
- } catch (AlgebricksException e) {
- throw new AlgebricksException(e);
- }
- switch (t.getTypeTag()) {
- case UNORDEREDLIST:
- case ORDEREDLIST: {
- AbstractCollectionType act = (AbstractCollectionType) t;
- return act.getItemType();
- }
- case UNION: {
- AUnionType ut = (AUnionType) t;
- if (!ut.isNullableType()) {
- throw new AlgebricksException("Expecting collection type. Found " + t);
- }
- IAType t2 = ut.getUnionList().get(1);
- ATypeTag tag2 = t2.getTypeTag();
- if (tag2 == ATypeTag.UNORDEREDLIST || tag2 == ATypeTag.ORDEREDLIST) {
- AbstractCollectionType act = (AbstractCollectionType) t2;
- return act.getItemType();
- }
- throw new AlgebricksException("Expecting collection type. Found " + t);
- }
- default: {
- throw new AlgebricksException("Expecting collection type. Found " + t);
- }
- }
- }
- }, true);
+ addPrivateFunction(SUBSET_COLLECTION, SubsetCollectionTypeComputer.INSTANCE, true);
addFunction(SUBSTRING, SubstringTypeComputer.INSTANCE, true);
addFunction(SUM, NonTaggedNumericAggTypeComputer.INSTANCE, true);
addPrivateFunction(LOCAL_SUM, NonTaggedNumericAggTypeComputer.INSTANCE, true);
@@ -991,14 +930,19 @@
addFunction(TID, AInt64TypeComputer.INSTANCE, true);
addFunction(TIME_CONSTRUCTOR, OptionalATimeTypeComputer.INSTANCE, true);
addPrivateFunction(TYPE_OF, null, true);
+ addPrivateFunction(UNION, UnorderedListConstructorResultType.INSTANCE, true);
addPrivateFunction(UNORDERED_LIST_CONSTRUCTOR, UnorderedListConstructorResultType.INSTANCE, true);
- addFunction(WORD_TOKENS, new IResultTypeComputer() {
- @Override
- public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
- IMetadataProvider<?, ?> mp) throws AlgebricksException {
- return new AOrderedListType(BuiltinType.ASTRING, "string");
- }
- }, true);
+ addFunction(WORD_TOKENS, OrderedListOfAStringTypeComputer.INSTANCE, true);
+
+ // records
+ addPrivateFunction(RECORD_MERGE, RecordMergeTypeComputer.INSTANCE, true);
+ addPrivateFunction(CLOSED_RECORD_CONSTRUCTOR, ClosedRecordConstructorResultType.INSTANCE, true);
+ addPrivateFunction(OPEN_RECORD_CONSTRUCTOR, OpenRecordConstructorResultType.INSTANCE, true);
+ addPrivateFunction(FIELD_ACCESS_BY_INDEX, FieldAccessByIndexResultType.INSTANCE, true);
+ addPrivateFunction(FIELD_ACCESS_NESTED, FieldAccessNestedResultType.INSTANCE, true);
+ addPrivateFunction(FIELD_ACCESS_BY_NAME, NonTaggedFieldAccessByNameResultType.INSTANCE, true);
+ addFunction(GET_RECORD_FIELDS, OrderedListOfAnyTypeComputer.INSTANCE, true);
+ addFunction(GET_RECORD_FIELD_VALUE, FieldAccessNestedResultType.INSTANCE, true);
// temporal type accessors
addFunction(ACCESSOR_TEMPORAL_YEAR, OptionalAInt64TypeComputer.INSTANCE, true);
@@ -1079,16 +1023,7 @@
addPrivateFunction(COLLECTION_TO_SEQUENCE, CollectionToSequenceTypeComputer.INSTANCE, true);
// external lookup
- addPrivateFunction(EXTERNAL_LOOKUP, new IResultTypeComputer() {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
- IMetadataProvider<?, ?> mp) throws AlgebricksException {
- return BuiltinType.ANY;
- }
- }, false);
+ addPrivateFunction(EXTERNAL_LOOKUP, AnyTypeComputer.INSTANCE, false);
String metadataFunctionLoaderClassName = "edu.uci.ics.asterix.metadata.functions.MetadataBuiltinFunctions";
try {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListVisitablePointable.java
similarity index 96%
rename from asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListPointable.java
rename to asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListVisitablePointable.java
index 3c38cad..efa698f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListPointable.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/AListVisitablePointable.java
@@ -37,7 +37,7 @@
* call getItems and getItemTags to get pointable objects for items and item
* type tags.
*/
-public class AListPointable extends AbstractVisitablePointable {
+public class AListVisitablePointable extends AbstractVisitablePointable {
/**
* DO NOT allow to create AListPointable object arbitrarily, force to use
@@ -45,7 +45,7 @@
*/
static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
public IVisitablePointable create(IAType type) {
- return new AListPointable((AbstractCollectionType) type);
+ return new AListVisitablePointable((AbstractCollectionType) type);
}
};
@@ -66,7 +66,7 @@
*
* @param inputType
*/
- private AListPointable(AbstractCollectionType inputType) {
+ public AListVisitablePointable(AbstractCollectionType inputType) {
if (inputType instanceof AOrderedListType) {
ordered = true;
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordVisitablePointable.java
similarity index 97%
rename from asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
rename to asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordVisitablePointable.java
index 68f0854..9ea28d7 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordVisitablePointable.java
@@ -40,7 +40,7 @@
* call getFieldNames, getFieldTypeTags and getFieldValues to get pointable
* objects for field names, field type tags, and field values.
*/
-public class ARecordPointable extends AbstractVisitablePointable {
+public class ARecordVisitablePointable extends AbstractVisitablePointable {
/**
* DO NOT allow to create ARecordPointable object arbitrarily, force to use
@@ -48,7 +48,7 @@
*/
static IObjectFactory<IVisitablePointable, IAType> FACTORY = new IObjectFactory<IVisitablePointable, IAType>() {
public IVisitablePointable create(IAType type) {
- return new ARecordPointable((ARecordType) type);
+ return new ARecordVisitablePointable((ARecordType) type);
}
};
@@ -81,7 +81,7 @@
*
* @param inputType
*/
- private ARecordPointable(ARecordType inputType) {
+ public ARecordVisitablePointable(ARecordType inputType) {
this.inputRecType = inputType;
IAType[] fieldTypes = inputType.getFieldTypes();
String[] fieldNameStrs = inputType.getFieldNames();
@@ -275,11 +275,11 @@
public List<IVisitablePointable> getFieldValues() {
return fieldValues;
}
-
- public ARecordType getInputRecordType(){
+
+ public ARecordType getInputRecordType() {
return inputRecType;
}
-
+
@Override
public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
return vistor.visit(this, tag);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java
index bbea453..b616b59 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/PointableAllocator.java
@@ -36,9 +36,9 @@
private IObjectPool<IVisitablePointable, IAType> flatValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
AFlatValuePointable.FACTORY);
private IObjectPool<IVisitablePointable, IAType> recordValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
- ARecordPointable.FACTORY);
+ ARecordVisitablePointable.FACTORY);
private IObjectPool<IVisitablePointable, IAType> listValueAllocator = new ListObjectPool<IVisitablePointable, IAType>(
- AListPointable.FACTORY);
+ AListVisitablePointable.FACTORY);
private IObjectPool<AOrderedListType, IAType> orederedListTypeAllocator = new ListObjectPool<AOrderedListType, IAType>(
new IObjectFactory<AOrderedListType, IAType>() {
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java
index 7626b88..06e44ba 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ACastVisitor.java
@@ -22,8 +22,8 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
@@ -54,7 +54,7 @@
private final Map<IVisitablePointable, AListCaster> laccessorToCaster = new HashMap<IVisitablePointable, AListCaster>();
@Override
- public Void visit(AListPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
+ public Void visit(AListVisitablePointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
throws AsterixException {
AListCaster caster = laccessorToCaster.get(accessor);
if (caster == null) {
@@ -73,7 +73,7 @@
}
@Override
- public Void visit(ARecordPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
+ public Void visit(ARecordVisitablePointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg)
throws AsterixException {
ARecordCaster caster = raccessorToCaster.get(accessor);
if (caster == null) {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java
index 5fdd438..afc3305 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/AListCaster.java
@@ -23,7 +23,7 @@
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.builders.UnorderedListBuilder;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
import edu.uci.ics.asterix.om.pointables.PointableAllocator;
import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
@@ -60,7 +60,7 @@
}
- public void castList(AListPointable listAccessor, IVisitablePointable resultAccessor,
+ public void castList(AListVisitablePointable listAccessor, IVisitablePointable resultAccessor,
AbstractCollectionType reqType, ACastVisitor visitor) throws IOException, AsterixException {
if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
unOrderedListBuilder.reset((AUnorderedListType) reqType);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java
index 988df90..8f3a219 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/cast/ARecordCaster.java
@@ -27,7 +27,7 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.common.exceptions.TypeException;
import edu.uci.ics.asterix.dataflow.data.nontagged.AqlNullWriterFactory;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.PointableAllocator;
import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
@@ -108,7 +108,7 @@
}
}
- public void castRecord(ARecordPointable recordAccessor, IVisitablePointable resultAccessor, ARecordType reqType,
+ public void castRecord(ARecordVisitablePointable recordAccessor, IVisitablePointable resultAccessor, ARecordType reqType,
ACastVisitor visitor) throws IOException, TypeException {
List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
List<IVisitablePointable> fieldTypeTags = recordAccessor.getFieldTypeTags();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/nonvisitor/AListPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/nonvisitor/AListPointable.java
new file mode 100644
index 0000000..d14443d
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/nonvisitor/AListPointable.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+
+package edu.uci.ics.asterix.om.pointables.nonvisitor;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
+import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
+import edu.uci.ics.hyracks.data.std.api.IPointable;
+import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
+import edu.uci.ics.hyracks.data.std.primitive.BytePointable;
+import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
+
+/*
+ * This class interprets the binary data representation of a list.
+ *
+ * List {
+ * byte type;
+ * int length;
+ * int numberOfItems;
+ * int[numberOfItems] itemOffset;
+ * IPointable[numberOfItems] item;
+ */
+public class AListPointable extends AbstractPointable {
+
+ public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public boolean isFixedLength() {
+ return false;
+ }
+
+ @Override
+ public int getFixedLength() {
+ return 0;
+ }
+ };
+
+ public static final IPointableFactory FACTORY = new IPointableFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IPointable createPointable() {
+ return new AListPointable();
+ }
+
+ @Override
+ public ITypeTraits getTypeTraits() {
+ return TYPE_TRAITS;
+ }
+ };
+
+ public static final IObjectFactory<IPointable, String> ALLOCATOR = new IObjectFactory<IPointable, String>() {
+ public IPointable create(String id) {
+ return new AListPointable();
+ }
+ };
+
+ private static final int TAG_SIZE = 1;
+ private static final int TYPE_SIZE = 1;
+ private static final int LENGTH_SIZE = 4;
+ private static final int ITEM_COUNT_SIZE = 4;
+ private static final int ITEM_OFFSET_SIZE = 4;
+
+ public byte getTag() {
+ return BytePointable.getByte(bytes, getTagOffset());
+ }
+
+ public int getTagOffset() {
+ return start;
+ }
+
+ public int getTagSize() {
+ return TAG_SIZE;
+ }
+
+ public byte getType() {
+ return BytePointable.getByte(bytes, getTypeOffset());
+ }
+
+ public int getTypeOffset() {
+ return getTagOffset() + getTagSize();
+ }
+
+ public int getTypeSize() {
+ return TYPE_SIZE;
+ }
+
+ public boolean isTyped() {
+ if (getType() != ATypeTag.ANY.serialize()) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isFixedType(AbstractCollectionType inputType) {
+ return NonTaggedFormatUtil.isFixedSizedCollection(inputType.getItemType());
+ }
+
+ public int getFixedLength(AbstractCollectionType inputType) throws AsterixException {
+ return NonTaggedFormatUtil.getFieldValueLength(bytes, 0, inputType.getItemType().getTypeTag(), false);
+ }
+
+ public boolean isOrdered(AbstractCollectionType inputType) {
+ if (inputType instanceof AOrderedListType) {
+ return true;
+ }
+ return false;
+ }
+
+ public int getLength() {
+ return IntegerPointable.getInteger(bytes, getLengthOffset());
+ }
+
+ public int getLengthOffset() {
+ return getTypeOffset() + getTypeSize();
+ }
+
+ public int getLengthSize() {
+ return LENGTH_SIZE;
+ }
+
+ public int getItemCount() {
+ return IntegerPointable.getInteger(bytes, getItemCountOffset());
+ }
+
+ public int getItemCountOffset() {
+ return getLengthOffset() + getLengthSize();
+ }
+
+ public int getItemCountSize() {
+ return ITEM_COUNT_SIZE;
+ }
+
+ // ----------------------
+ // Item accessors
+ // ----------------------
+
+ public int getItemOffset(AbstractCollectionType inputType, int index) throws AsterixException {
+ if (isFixedType(inputType)) {
+ return getItemCountOffset() + getItemCountSize() + index * getFixedLength(inputType);
+ } else {
+ int offset = getItemCountOffset() + getItemCountSize() + index * ITEM_OFFSET_SIZE;
+ return IntegerPointable.getInteger(bytes, offset);
+ }
+ }
+
+ public byte getItemTag(AbstractCollectionType inputType, int index) throws AsterixException {
+ if (getType() != ATypeTag.ANY.serialize()) {
+ return getType();
+ }
+ return bytes[getItemOffset(inputType, index)];
+ }
+
+ public int getItemSize(AbstractCollectionType inputType, int index) throws AsterixException {
+ if (isFixedType(inputType)) {
+ return getFixedLength(inputType);
+ } else {
+ int nextOffset = (getItemCount() > index + 1) ? getItemOffset(inputType, index + 1) : getLength();
+ return nextOffset - getItemOffset(inputType, index);
+ }
+ }
+
+ public void getItemValue(AbstractCollectionType inputType, int index, DataOutput dOut) throws IOException,
+ AsterixException {
+ if (getType() != ATypeTag.ANY.serialize()) {
+ dOut.writeByte(getType());
+ }
+ dOut.write(bytes, getItemOffset(inputType, index), getItemSize(inputType, index));
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/nonvisitor/ARecordPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/nonvisitor/ARecordPointable.java
new file mode 100644
index 0000000..cb0e136
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/nonvisitor/ARecordPointable.java
@@ -0,0 +1,335 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+
+package edu.uci.ics.asterix.om.pointables.nonvisitor;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Arrays;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.om.util.container.IObjectFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
+import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
+import edu.uci.ics.hyracks.data.std.api.IPointable;
+import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
+import edu.uci.ics.hyracks.data.std.primitive.BooleanPointable;
+import edu.uci.ics.hyracks.data.std.primitive.BytePointable;
+import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
+import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
+
+/*
+ * This class interprets the binary data representation of a record.
+ *
+ * Record {
+ * byte tag;
+ * int length;
+ * byte isExpanded;
+ * int openOffset?;
+ * int numberOfClosedFields;
+ * byte[ceil (numberOfFields / 8)] nullBitMap; // 1 bit per field, "1" means field is Null for this record
+ * int[numberOfClosedFields] closedFieldOffset;
+ * IPointable[numberOfClosedFields] fieldValue;
+ * int numberOfOpenFields?;
+ * OpenFieldLookup[numberOfOpenFields] lookup;
+ * OpenField[numberOfOpenFields] openFields;
+ * }
+ *
+ * OpenFieldLookup {
+ * int hashCode;
+ * int Offset;
+ * }
+ *
+ * OpenField {
+ * StringPointable fieldName;
+ * IPointable fieldValue;
+ * }
+ */
+public class ARecordPointable extends AbstractPointable {
+
+ public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public boolean isFixedLength() {
+ return false;
+ }
+
+ @Override
+ public int getFixedLength() {
+ return 0;
+ }
+ };
+
+ public static final IPointableFactory FACTORY = new IPointableFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IPointable createPointable() {
+ return new ARecordPointable();
+ }
+
+ @Override
+ public ITypeTraits getTypeTraits() {
+ return TYPE_TRAITS;
+ }
+ };
+
+ public static final IObjectFactory<IPointable, String> ALLOCATOR = new IObjectFactory<IPointable, String>() {
+ public IPointable create(String id) {
+ return new ARecordPointable();
+ }
+ };
+
+
+ private static final int TAG_SIZE = 1;
+ private static final int RECORD_LENGTH_SIZE = 4;
+ private static final int EXPANDED_SIZE = 1;
+ private static final int OPEN_OFFSET_SIZE = 4;
+ private static final int CLOSED_COUNT_SIZE = 4;
+ private static final int FIELD_OFFSET_SIZE = 4;
+ private static final int OPEN_COUNT_SIZE = 4;
+ private static final int OPEN_FIELD_HASH_SIZE = 4;
+ private static final int OPEN_FIELD_OFFSET_SIZE = 4;
+ private static final int OPEN_FIELD_HEADER = OPEN_FIELD_HASH_SIZE + OPEN_FIELD_OFFSET_SIZE;
+
+ private static final int STRING_LENGTH_SIZE = 2;
+
+ private static boolean isOpen(ARecordType recordType) {
+ return recordType == null || recordType.isOpen();
+ }
+
+ public int getSchemeFieldCount(ARecordType recordType) {
+ return recordType.getFieldNames().length;
+ }
+
+ public byte getTag() {
+ return BytePointable.getByte(bytes, getTagOffset());
+ }
+
+ public int getTagOffset() {
+ return start;
+ }
+
+ public int getTagSize() {
+ return TAG_SIZE;
+ }
+
+ public int getLength() {
+ return IntegerPointable.getInteger(bytes, getLengthOffset());
+ }
+
+ public int getLengthOffset() {
+ return getTagOffset() + getTagSize();
+ }
+
+ public int getLengthSize() {
+ return RECORD_LENGTH_SIZE;
+ }
+
+ public boolean isExpanded(ARecordType recordType) {
+ if (isOpen(recordType)) {
+ return BooleanPointable.getBoolean(bytes, getExpendedOffset(recordType));
+ }
+ return false;
+ }
+
+ public int getExpendedOffset(ARecordType recordType) {
+ return getLengthOffset() + getLengthSize();
+ }
+
+ public int getExpandedSize(ARecordType recordType) {
+ return (isOpen(recordType)) ? EXPANDED_SIZE : 0;
+ }
+
+ public int getOpenPart(ARecordType recordType) {
+ return IntegerPointable.getInteger(bytes, getOpenPartOffset(recordType));
+ }
+
+ public int getOpenPartOffset(ARecordType recordType) {
+ return getExpendedOffset(recordType) + getExpandedSize(recordType);
+ }
+
+ public int getOpenPartSize(ARecordType recordType) {
+ return (isExpanded(recordType)) ? OPEN_OFFSET_SIZE : 0;
+ }
+
+ public int getClosedFieldCount(ARecordType recordType) {
+ return IntegerPointable.getInteger(bytes, getClosedFieldCountOffset(recordType));
+ }
+
+ public int getClosedFieldCountOffset(ARecordType recordType) {
+ return getOpenPartOffset(recordType) + getOpenPartSize(recordType);
+ }
+
+ public int getClosedFieldCountSize(ARecordType recordType) {
+ return CLOSED_COUNT_SIZE;
+ }
+
+ public byte[] getNullBitmap(ARecordType recordType) {
+ if (getNullBitmapSize(recordType) > 0) {
+ return Arrays.copyOfRange(bytes, getNullBitmapOffset(recordType), getNullBitmapSize(recordType));
+ }
+ return null;
+ }
+
+ public int getNullBitmapOffset(ARecordType recordType) {
+ return getClosedFieldCountOffset(recordType) + getClosedFieldCountSize(recordType);
+ }
+
+ public int getNullBitmapSize(ARecordType recordType) {
+ return ARecordType.computeNullBitmapSize(recordType);
+ }
+
+ public boolean isClosedFieldNull(ARecordType recordType, int fieldId) {
+ if (getNullBitmapSize(recordType) > 0) {
+ return ((bytes[getNullBitmapOffset(recordType) + fieldId / 8] & (1 << (7 - (fieldId % 8)))) == 0);
+ }
+ return false;
+ }
+
+ // -----------------------
+ // Closed field accessors.
+ // -----------------------
+
+ public void getClosedFieldValue(ARecordType recordType, int fieldId, DataOutput dOut) throws IOException,
+ AsterixException {
+ if (isClosedFieldNull(recordType, fieldId)) {
+ dOut.writeByte(ATypeTag.NULL.serialize());
+ } else {
+ dOut.write(getClosedFieldTag(recordType, fieldId));
+ dOut.write(bytes, getClosedFieldOffset(recordType, fieldId), getClosedFieldSize(recordType, fieldId));
+ }
+ }
+
+ public String getClosedFieldName(ARecordType recordType, int fieldId) {
+ return recordType.getFieldNames()[fieldId];
+ }
+
+ public void getClosedFieldName(ARecordType recordType, int fieldId, DataOutput dOut) throws IOException {
+ dOut.writeByte(ATypeTag.STRING.serialize());
+ dOut.writeUTF(getClosedFieldName(recordType, fieldId));
+ }
+
+ public byte getClosedFieldTag(ARecordType recordType, int fieldId) {
+ return getClosedFieldType(recordType, fieldId).getTypeTag().serialize();
+ }
+
+ public IAType getClosedFieldType(ARecordType recordType, int fieldId) {
+ IAType aType = recordType.getFieldTypes()[fieldId];
+ if (aType.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) aType)) {
+ // optional field: add the embedded non-null type tag
+ aType = ((AUnionType) aType).getUnionList().get(AUnionType.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
+ }
+ return aType;
+ }
+
+ public int getClosedFieldSize(ARecordType recordType, int fieldId) throws AsterixException {
+ if (isClosedFieldNull(recordType, fieldId)) {
+ return 0;
+ }
+ return NonTaggedFormatUtil.getFieldValueLength(bytes, getClosedFieldOffset(recordType, fieldId),
+ getClosedFieldType(recordType, fieldId).getTypeTag(), false);
+ }
+
+ public int getClosedFieldOffset(ARecordType recordType, int fieldId) {
+ int offset = getNullBitmapOffset(recordType) + getNullBitmapSize(recordType) + fieldId * FIELD_OFFSET_SIZE;
+ return IntegerPointable.getInteger(bytes, offset);
+ }
+
+ // -----------------------
+ // Open field count.
+ // -----------------------
+
+ public int getOpenFieldCount(ARecordType recordType) {
+ return isExpanded(recordType) ? IntegerPointable.getInteger(bytes, getOpenFieldCountOffset(recordType)) : 0;
+ }
+
+ public int getOpenFieldCountSize(ARecordType recordType) {
+ return (isExpanded(recordType)) ? OPEN_COUNT_SIZE : 0;
+ }
+
+ public int getOpenFieldCountOffset(ARecordType recordType) {
+ return getOpenPart(recordType);
+ }
+
+ // -----------------------
+ // Open field accessors.
+ // -----------------------
+
+ public void getOpenFieldValue(ARecordType recordType, int fieldId, DataOutput dOut) throws IOException,
+ AsterixException {
+ dOut.write(bytes, getOpenFieldValueOffset(recordType, fieldId), getOpenFieldValueSize(recordType, fieldId));
+ }
+
+ public int getOpenFieldValueOffset(ARecordType recordType, int fieldId) {
+ return getOpenFieldNameOffset(recordType, fieldId) + getOpenFieldNameSize(recordType, fieldId);
+ }
+
+ public int getOpenFieldValueSize(ARecordType recordType, int fieldId) throws AsterixException {
+ int offset = getOpenFieldValueOffset(recordType, fieldId);
+ ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(getOpenFieldTag(recordType, fieldId));
+ return NonTaggedFormatUtil.getFieldValueLength(bytes, offset, tag, true);
+ }
+
+ public void getOpenFieldName(ARecordType recordType, int fieldId, DataOutput dOut) throws IOException {
+ dOut.writeByte(ATypeTag.STRING.serialize());
+ dOut.write(bytes, getOpenFieldNameOffset(recordType, fieldId), getOpenFieldNameSize(recordType, fieldId));
+ }
+
+ public int getOpenFieldNameSize(ARecordType recordType, int fieldId) {
+ return UTF8StringPointable.getUTFLength(bytes, getOpenFieldNameOffset(recordType, fieldId))
+ + STRING_LENGTH_SIZE;
+ }
+
+ public int getOpenFieldNameOffset(ARecordType recordType, int fieldId) {
+ return getOpenFieldOffset(recordType, fieldId);
+ }
+
+ public byte getOpenFieldTag(ARecordType recordType, int fieldId) {
+ return bytes[getOpenFieldValueOffset(recordType, fieldId)];
+ }
+
+ public int getOpenFieldHash(ARecordType recordType, int fieldId) {
+ return IntegerPointable.getInteger(bytes, getOpenFieldHashOffset(recordType, fieldId));
+ }
+
+ public int getOpenFieldHashOffset(ARecordType recordType, int fieldId) {
+ return getOpenFieldCountOffset(recordType) + getOpenFieldCountSize(recordType) + fieldId * OPEN_FIELD_HEADER;
+ }
+
+ public int getOpenFieldHashSize(ARecordType recordType, int fieldId) {
+ return OPEN_FIELD_HASH_SIZE;
+ }
+
+ public int getOpenFieldOffset(ARecordType recordType, int fieldId) {
+ return IntegerPointable.getInteger(bytes, getOpenFieldOffsetOffset(recordType, fieldId));
+ }
+
+ public int getOpenFieldOffsetOffset(ARecordType recordType, int fieldId) {
+ return getOpenFieldHashOffset(recordType, fieldId) + getOpenFieldHashSize(recordType, fieldId);
+ }
+
+ public int getOpenFieldOffsetSize(ARecordType recordType, int fieldId) {
+ return OPEN_FIELD_HASH_SIZE;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java
index 74b0bfc..ffb975a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/AListPrinter.java
@@ -20,7 +20,7 @@
import java.util.List;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
@@ -48,7 +48,7 @@
}
}
- public void printList(AListPointable listAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ public void printList(AListVisitablePointable listAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
AsterixException {
List<IVisitablePointable> itemTags = listAccessor.getItemTags();
List<IVisitablePointable> items = listAccessor.getItems();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
index 7d4cc86..578b47c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
@@ -46,8 +46,8 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AYearMonthDurationPrinter;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ShortWithoutTypeInfoPrinter;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -65,7 +65,7 @@
private final Map<IVisitablePointable, AListPrinter> laccessorToPrinter = new HashMap<IVisitablePointable, AListPrinter>();
@Override
- public Void visit(AListPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ public Void visit(AListVisitablePointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
AListPrinter printer = laccessorToPrinter.get(accessor);
if (printer == null) {
printer = new AListPrinter(accessor.ordered());
@@ -80,7 +80,7 @@
}
@Override
- public Void visit(ARecordPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ public Void visit(ARecordVisitablePointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
ARecordPrinter printer = raccessorToPrinter.get(accessor);
if (printer == null) {
printer = new ARecordPrinter();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java
index 1dd75c3..d48a395 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/ARecordPrinter.java
@@ -20,7 +20,7 @@
import java.util.List;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
@@ -43,7 +43,7 @@
}
- public void printRecord(ARecordPointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ public void printRecord(ARecordVisitablePointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
AsterixException {
List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
List<IVisitablePointable> fieldTags = recordAccessor.getFieldTypeTags();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/APrintVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/APrintVisitor.java
index 8461cc4..549be5f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/APrintVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/APrintVisitor.java
@@ -44,8 +44,8 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.ATimePrinter;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.csv.AYearMonthDurationPrinter;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -64,12 +64,12 @@
private int level = 0;
@Override
- public Void visit(AListPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ public Void visit(AListVisitablePointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
throw new AsterixException("'List' type unsupported for CSV output");
}
@Override
- public Void visit(ARecordPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ public Void visit(ARecordVisitablePointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
ARecordPrinter printer = raccessorToPrinter.get(accessor);
if (printer == null) {
printer = new ARecordPrinter();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/ARecordPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/ARecordPrinter.java
index fbb6d9b..8e2b6ac 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/ARecordPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/csv/ARecordPrinter.java
@@ -20,7 +20,7 @@
import java.util.List;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
@@ -41,7 +41,7 @@
}
- public void printRecord(ARecordPointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ public void printRecord(ARecordVisitablePointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
AsterixException {
List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
List<IVisitablePointable> fieldTags = recordAccessor.getFieldTypeTags();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java
index 3328d7f..8b91a06 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java
@@ -20,7 +20,7 @@
import java.util.List;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
@@ -45,7 +45,7 @@
}
}
- public void printList(AListPointable listAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ public void printList(AListVisitablePointable listAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
AsterixException {
List<IVisitablePointable> itemTags = listAccessor.getItemTags();
List<IVisitablePointable> items = listAccessor.getItems();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java
index e284621..0997791 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java
@@ -45,8 +45,8 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ATimePrinter;
import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AYearMonthDurationPrinter;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -64,7 +64,7 @@
private final Map<IVisitablePointable, AListPrinter> laccessorToPrinter = new HashMap<IVisitablePointable, AListPrinter>();
@Override
- public Void visit(AListPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ public Void visit(AListVisitablePointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
AListPrinter printer = laccessorToPrinter.get(accessor);
if (printer == null) {
printer = new AListPrinter(accessor.ordered());
@@ -79,7 +79,7 @@
}
@Override
- public Void visit(ARecordPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+ public Void visit(ARecordVisitablePointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
ARecordPrinter printer = raccessorToPrinter.get(accessor);
if (printer == null) {
printer = new ARecordPrinter();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java
index c7a5654..1fde70f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java
@@ -20,7 +20,7 @@
import java.util.List;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
@@ -43,7 +43,7 @@
}
- public void printRecord(ARecordPointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+ public void printRecord(ARecordVisitablePointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
AsterixException {
List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
List<IVisitablePointable> fieldTags = recordAccessor.getFieldTypeTags();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java
index af7e7d2..ec6d2f4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/visitor/IVisitablePointableVisitor.java
@@ -17,8 +17,8 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
-import edu.uci.ics.asterix.om.pointables.AListPointable;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.AListVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
/**
* This interface is a visitor for all the three different IVisitablePointable
@@ -27,9 +27,9 @@
*/
public interface IVisitablePointableVisitor<R, T> {
- public R visit(AListPointable accessor, T arg) throws AsterixException;
+ public R visit(AListVisitablePointable accessor, T arg) throws AsterixException;
- public R visit(ARecordPointable accessor, T arg) throws AsterixException;
+ public R visit(ARecordVisitablePointable accessor, T arg) throws AsterixException;
public R visit(AFlatValuePointable accessor, T arg) throws AsterixException;
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AnyTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AnyTypeComputer.java
new file mode 100644
index 0000000..94d3e1d
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AnyTypeComputer.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.om.typecomputer.impl;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
+
+public class AnyTypeComputer implements IResultTypeComputer {
+
+ public static final AnyTypeComputer INSTANCE = new AnyTypeComputer();
+
+ private AnyTypeComputer() {
+ }
+
+ @Override
+ public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
+ IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
+ return BuiltinType.ANY;
+ }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessNestedResultType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessNestedResultType.java
index 2aef736..fbc2ca8 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessNestedResultType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/FieldAccessNestedResultType.java
@@ -36,7 +36,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
public class FieldAccessNestedResultType implements IResultTypeComputer {
-
+ private static final long serialVersionUID = 1L;
public static final FieldAccessNestedResultType INSTANCE = new FieldAccessNestedResultType();
private FieldAccessNestedResultType() {
@@ -65,15 +65,24 @@
throw new AlgebricksException("Typing error: expecting a constant value, found " + ce + " instead.");
}
IAObject v = ((AsterixConstantValue) ce.getValue()).getObject();
- if (v.getType().getTypeTag() != ATypeTag.ORDEREDLIST) {
+ List<String> fieldPath = new ArrayList<String>();
+ if (v.getType().getTypeTag() == ATypeTag.ORDEREDLIST) {
+ for (int i = 0; i < ((AOrderedList) v).size(); i++) {
+ fieldPath.add(((AString) ((AOrderedList) v).getItem(i)).getStringValue());
+ }
+ } else if (v.getType().getTypeTag() == ATypeTag.STRING) {
+ fieldPath.add(((AString) v).getStringValue());
+ } else {
throw new AlgebricksException("Typing error: expecting a String, found " + ce + " instead.");
}
- List<String> fieldPath = new ArrayList<String>();
- for (int i = 0; i < ((AOrderedList)v).size(); i++){
- fieldPath.add(((AString)((AOrderedList) v).getItem(i)).getStringValue());
- }
try {
- return t0.getSubFieldType(fieldPath);
+ IAType subType = t0.getSubFieldType(fieldPath);
+ if (subType != null) {
+ return subType;
+ } else {
+ // Open field. Type can only be determined at runtime.
+ return BuiltinType.ANY;
+ }
} catch (IOException e) {
throw new AlgebricksException("FieldPath was invalid.");
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubsetCollectionTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubsetCollectionTypeComputer.java
new file mode 100644
index 0000000..b2b829b
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/SubsetCollectionTypeComputer.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.om.typecomputer.impl;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
+
+public class SubsetCollectionTypeComputer implements IResultTypeComputer {
+
+ public static final SubsetCollectionTypeComputer INSTANCE = new SubsetCollectionTypeComputer();
+
+ private SubsetCollectionTypeComputer() {
+ }
+
+ @Override
+ public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env, IMetadataProvider<?, ?> mp)
+ throws AlgebricksException {
+ AbstractFunctionCallExpression fun = (AbstractFunctionCallExpression) expression;
+ IAType t;
+ try {
+ t = (IAType) env.getType(fun.getArguments().get(0).getValue());
+ } catch (AlgebricksException e) {
+ throw new AlgebricksException(e);
+ }
+ switch (t.getTypeTag()) {
+ case UNORDEREDLIST:
+ case ORDEREDLIST: {
+ AbstractCollectionType act = (AbstractCollectionType) t;
+ return act.getItemType();
+ }
+ case UNION: {
+ AUnionType ut = (AUnionType) t;
+ if (!ut.isNullableType()) {
+ throw new AlgebricksException("Expecting collection type. Found " + t);
+ }
+ IAType t2 = ut.getUnionList().get(1);
+ ATypeTag tag2 = t2.getTypeTag();
+ if (tag2 == ATypeTag.UNORDEREDLIST || tag2 == ATypeTag.ORDEREDLIST) {
+ AbstractCollectionType act = (AbstractCollectionType) t2;
+ return act.getItemType();
+ }
+ throw new AlgebricksException("Expecting collection type. Found " + t);
+ }
+ default: {
+ throw new AlgebricksException("Expecting collection type. Found " + t);
+ }
+ }
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
index e141660..db83bf3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
@@ -47,6 +47,7 @@
case RECORD:
case ORDEREDLIST:
case UNORDEREDLIST:
+ case POLYGON:
case ANY:
return false;
case UNION:
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessNestedEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessNestedEvalFactory.java
deleted file mode 100644
index bb98253..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessNestedEvalFactory.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- *
- * 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.
- */
-
-package edu.uci.ics.asterix.runtime.evaluators.common;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.ANull;
-import edu.uci.ics.asterix.om.base.AString;
-import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnionType;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-
-public class FieldAccessNestedEvalFactory implements ICopyEvaluatorFactory {
-
- private static final long serialVersionUID = 1L;
-
- private ICopyEvaluatorFactory recordEvalFactory;
- private ICopyEvaluatorFactory fldNameEvalFactory;
- private ARecordType recordType;
- private List<String> fieldPath;
-
- private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
- private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
-
- public FieldAccessNestedEvalFactory(ICopyEvaluatorFactory recordEvalFactory,
- ICopyEvaluatorFactory fldNameEvalFactory, ARecordType recordType, List<String> fldName) {
- this.recordEvalFactory = recordEvalFactory;
- this.fldNameEvalFactory = fldNameEvalFactory;
- this.recordType = recordType;
- this.fieldPath = fldName;
-
- }
-
- @Override
- public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
- return new ICopyEvaluator() {
-
- private DataOutput out = output.getDataOutput();
-
- private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
- private ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
- private ByteArrayAccessibleOutputStream subRecordTmpStream = new ByteArrayAccessibleOutputStream();
- private ICopyEvaluator eval0 = recordEvalFactory.createEvaluator(outInput0);
- private ICopyEvaluator eval1 = fldNameEvalFactory.createEvaluator(outInput1);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- private ArrayBackedValueStorage[] abvs = new ArrayBackedValueStorage[fieldPath.size()];
- private DataOutput[] dos = new DataOutput[fieldPath.size()];
- private AString[] as = new AString[fieldPath.size()];
-
- {
- for (int i = 0; i < fieldPath.size(); i++) {
- abvs[i] = new ArrayBackedValueStorage();
- dos[i] = abvs[i].getDataOutput();
- as[i] = new AString(fieldPath.get(i));
- try {
- AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(as[i].getType())
- .serialize(as[i], dos[i]);
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
- }
- }
- recordType = recordType.deepCopy(recordType);
-
- }
-
- public int checkType(byte[] serRecord) throws AlgebricksException {
- if (serRecord[0] == SER_NULL_TYPE_TAG) {
- try {
- nullSerde.serialize(ANull.NULL, out);
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
- }
- return -1;
- }
-
- if (serRecord[0] != SER_RECORD_TYPE_TAG) {
- throw new AlgebricksException("Field accessor is not defined for values of type "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[0]));
- }
- return 0;
- }
-
- @Override
- public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
-
- try {
- outInput0.reset();
- eval0.evaluate(tuple);
- outInput1.reset();
- eval1.evaluate(tuple);
-
- int subFieldIndex = -1;
- int subFieldOffset = -1;
- int subFieldLength = -1;
- int nullBitmapSize = -1;
- IAType subType = recordType;
- ATypeTag subTypeTag = ATypeTag.NULL;
- byte[] subRecord = outInput0.getByteArray();
- boolean openField = false;
- int i = 0;
-
- if (checkType(subRecord) == -1) {
- return;
- }
-
- //Moving through closed fields
- for (; i < fieldPath.size(); i++) {
- if (subType.getTypeTag().equals(ATypeTag.UNION)) {
- //enforced SubType
- subType = ((AUnionType) subType).getUnionList().get(
- AUnionType.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
- if (subType.getTypeTag().serialize() != SER_RECORD_TYPE_TAG) {
- throw new AlgebricksException("Field accessor is not defined for values of type "
- + subTypeTag);
- }
-
- }
- subFieldIndex = ((ARecordType) subType).findFieldPosition(fieldPath.get(i));
- if (subFieldIndex == -1) {
- break;
- }
- nullBitmapSize = ARecordType.computeNullBitmapSize((ARecordType) subType);
- subFieldOffset = ARecordSerializerDeserializer.getFieldOffsetById(subRecord, subFieldIndex,
- nullBitmapSize, ((ARecordType) subType).isOpen());
- if (subFieldOffset == 0) {
- // the field is null, we checked the null bit map
- out.writeByte(SER_NULL_TYPE_TAG);
- return;
- }
- subType = ((ARecordType) subType).getFieldTypes()[subFieldIndex];
- if (subType.getTypeTag().equals(ATypeTag.UNION)) {
- if (NonTaggedFormatUtil.isOptionalField((AUnionType) subType)) {
- subTypeTag = ((AUnionType) subType).getUnionList()
- .get(AUnionType.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
- subFieldLength = NonTaggedFormatUtil.getFieldValueLength(subRecord, subFieldOffset,
- subTypeTag, false);
- } else {
- // union .. the general case
- throw new NotImplementedException();
- }
- } else {
- subTypeTag = subType.getTypeTag();
- subFieldLength = NonTaggedFormatUtil.getFieldValueLength(subRecord, subFieldOffset,
- subTypeTag, false);
- }
-
- if (i < fieldPath.size() - 1) {
- //setup next iteration
- subRecordTmpStream.reset();
- subRecordTmpStream.write(subTypeTag.serialize());
- subRecordTmpStream.write(subRecord, subFieldOffset, subFieldLength);
- subRecord = subRecordTmpStream.getByteArray();
-
- if (checkType(subRecord) == -1) {
- return;
- }
- }
- }
-
- //Moving through open fields
- for (; i < fieldPath.size(); i++) {
- openField = true;
- subFieldOffset = ARecordSerializerDeserializer.getFieldOffsetByName(subRecord,
- abvs[i].getByteArray());
- if (subFieldOffset < 0) {
- out.writeByte(SER_NULL_TYPE_TAG);
- return;
- }
-
- subTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(subRecord[subFieldOffset]);
- subFieldLength = NonTaggedFormatUtil.getFieldValueLength(subRecord, subFieldOffset, subTypeTag,
- true) + 1;
-
- if (i < fieldPath.size() - 1) {
- //setup next iteration
- subRecord = Arrays.copyOfRange(subRecord, subFieldOffset, subFieldOffset + subFieldLength);
-
- if (checkType(subRecord) == -1) {
- return;
- }
- }
- }
- if (!openField) {
- out.writeByte(subTypeTag.serialize());
- }
- out.write(subRecord, subFieldOffset, subFieldLength);
-
- } catch (IOException e) {
- throw new AlgebricksException(e);
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
- }
- }
- };
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ClosedRecordConstructorDescriptor.java
similarity index 96%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ClosedRecordConstructorDescriptor.java
index 383b7a3..dceb12a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ClosedRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ClosedRecordConstructorDescriptor.java
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.constructors;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
similarity index 98%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
index 1babb47..2f5ca11 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.constructors;
import java.io.DataOutput;
import java.io.IOException;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
deleted file mode 100644
index 3b7e545..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- *
- * 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.
- */
-package edu.uci.ics.asterix.runtime.evaluators.functions;
-
-import java.io.DataOutput;
-import java.io.IOException;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
-import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.ANull;
-import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
-import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.EnumDeserializer;
-import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
-import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-
-public class FieldAccessByNameDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
- private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- public IFunctionDescriptor createFunctionDescriptor() {
- return new FieldAccessByNameDescriptor();
- }
- };
-
- @Override
- public FunctionIdentifier getIdentifier() {
- return AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME;
- }
-
- @Override
- public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) {
- return new FieldAccessByNameEvalFactory(args[0], args[1]);
- }
-
- private static class FieldAccessByNameEvalFactory implements ICopyEvaluatorFactory {
-
- private static final long serialVersionUID = 1L;
-
- private ICopyEvaluatorFactory recordEvalFactory;
- private ICopyEvaluatorFactory fldNameEvalFactory;
-
- private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
- private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
-
- public FieldAccessByNameEvalFactory(ICopyEvaluatorFactory recordEvalFactory,
- ICopyEvaluatorFactory fldNameEvalFactory) {
- this.recordEvalFactory = recordEvalFactory;
- this.fldNameEvalFactory = fldNameEvalFactory;
- }
-
- @Override
- public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
- return new ICopyEvaluator() {
-
- private DataOutput out = output.getDataOutput();
-
- private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
- private ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
- private ICopyEvaluator eval0 = recordEvalFactory.createEvaluator(outInput0);
- private ICopyEvaluator eval1 = fldNameEvalFactory.createEvaluator(outInput1);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- private int fieldValueOffset;
- private int fieldValueLength;
- private ATypeTag fieldValueTypeTag = ATypeTag.NULL;
-
- @Override
- public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
-
- try {
- outInput0.reset();
- eval0.evaluate(tuple);
- outInput1.reset();
- eval1.evaluate(tuple);
- byte[] serRecord = outInput0.getByteArray();
-
- if (serRecord[0] == SER_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
- return;
- }
-
- if (serRecord[0] != SER_RECORD_TYPE_TAG) {
- throw new AlgebricksException(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME.getName()
- + ": expects input type NULL or RECORD, but got "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[0]));
- }
-
- byte[] serFldName = outInput1.getByteArray();
- fieldValueOffset = ARecordSerializerDeserializer.getFieldOffsetByName(serRecord, serFldName);
- if (fieldValueOffset < 0) {
- out.writeByte(ATypeTag.NULL.serialize());
- return;
- }
-
- fieldValueTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(serRecord[fieldValueOffset]);
- fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(serRecord, fieldValueOffset,
- fieldValueTypeTag, true) + 1;
- out.write(serRecord, fieldValueOffset, fieldValueLength);
-
- } catch (IOException e) {
- throw new AlgebricksException(e);
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
- }
- }
- };
- }
-
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByIndexDescriptor.java
similarity index 92%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByIndexDescriptor.java
index 9a2c19b..072edac 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByIndexDescriptor.java
@@ -12,14 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessByIndexEvalFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
similarity index 98%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
index 3303364..2b9f666 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.evaluators.common;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import java.io.DataOutput;
import java.io.IOException;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByNameDescriptor.java
similarity index 70%
copy from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
copy to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByNameDescriptor.java
index 9a2c19b..316eb9a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByNameDescriptor.java
@@ -3,49 +3,41 @@
* Licensed 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 from
- *
+ *
* 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.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessByIndexEvalFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-public class FieldAccessByIndexDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class FieldAccessByNameDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
- return new FieldAccessByIndexDescriptor();
+ return new FieldAccessByNameDescriptor();
}
};
- private ARecordType recType;
-
- public void reset(ARecordType recType) {
- this.recType = recType;
- }
-
@Override
public FunctionIdentifier getIdentifier() {
- return AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX;
+ return AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME;
}
@Override
public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) {
- return new FieldAccessByIndexEvalFactory(args[0], args[1], recType);
+ return new FieldAccessByNameEvalFactory(args[0], args[1]);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java
new file mode 100644
index 0000000..d9a10de
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class FieldAccessByNameEvalFactory implements ICopyEvaluatorFactory {
+
+ private static final long serialVersionUID = 1L;
+
+ private ICopyEvaluatorFactory recordEvalFactory;
+ private ICopyEvaluatorFactory fldNameEvalFactory;
+
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+ private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
+
+ public FieldAccessByNameEvalFactory(ICopyEvaluatorFactory recordEvalFactory,
+ ICopyEvaluatorFactory fldNameEvalFactory) {
+ this.recordEvalFactory = recordEvalFactory;
+ this.fldNameEvalFactory = fldNameEvalFactory;
+ }
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+
+ private DataOutput out = output.getDataOutput();
+
+ private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
+ private ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval0 = recordEvalFactory.createEvaluator(outInput0);
+ private ICopyEvaluator eval1 = fldNameEvalFactory.createEvaluator(outInput1);
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+ private int fieldValueOffset;
+ private int fieldValueLength;
+ private ATypeTag fieldValueTypeTag = ATypeTag.NULL;
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+
+ try {
+ outInput0.reset();
+ eval0.evaluate(tuple);
+ outInput1.reset();
+ eval1.evaluate(tuple);
+ byte[] serRecord = outInput0.getByteArray();
+
+ if (serRecord[0] == SER_NULL_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ return;
+ }
+
+ if (serRecord[0] != SER_RECORD_TYPE_TAG) {
+ throw new AlgebricksException(AsterixBuiltinFunctions.FIELD_ACCESS_BY_NAME.getName()
+ + ": expects input type NULL or RECORD, but got "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[0]));
+ }
+
+ byte[] serFldName = outInput1.getByteArray();
+ fieldValueOffset = ARecordSerializerDeserializer.getFieldOffsetByName(serRecord, serFldName);
+ if (fieldValueOffset < 0) {
+ out.writeByte(ATypeTag.NULL.serialize());
+ return;
+ }
+
+ fieldValueTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[fieldValueOffset]);
+ fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(serRecord, fieldValueOffset,
+ fieldValueTypeTag, true) + 1;
+ out.write(serRecord, fieldValueOffset, fieldValueLength);
+
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ } catch (AsterixException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessNestedDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessNestedDescriptor.java
similarity index 89%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessNestedDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessNestedDescriptor.java
index be2b043..4a79d93 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessNestedDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessNestedDescriptor.java
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import java.util.List;
@@ -21,7 +21,6 @@
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessNestedEvalFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
@@ -49,7 +48,7 @@
@Override
public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) {
- return new FieldAccessNestedEvalFactory(args[0], args[1], recType, fldName);
+ return new FieldAccessNestedEvalFactory(args[0], recType, fldName);
}
}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java
new file mode 100644
index 0000000..06c2109
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
+
+import java.io.DataOutput;
+import java.util.List;
+
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class FieldAccessNestedEvalFactory implements ICopyEvaluatorFactory {
+
+ private static final long serialVersionUID = 1L;
+
+ private ICopyEvaluatorFactory recordEvalFactory;
+ private ARecordType recordType;
+ private List<String> fieldPath;
+
+ public FieldAccessNestedEvalFactory(ICopyEvaluatorFactory recordEvalFactory, ARecordType recordType,
+ List<String> fldName) {
+ this.recordEvalFactory = recordEvalFactory;
+ this.recordType = recordType;
+ this.fieldPath = fldName;
+
+ }
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+
+ private DataOutput out = output.getDataOutput();
+ private ByteArrayAccessibleOutputStream subRecordTmpStream = new ByteArrayAccessibleOutputStream();
+
+ private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval0 = recordEvalFactory.createEvaluator(outInput0);
+ private ArrayBackedValueStorage[] abvsFields = new ArrayBackedValueStorage[fieldPath.size()];
+ private DataOutput[] doFields = new DataOutput[fieldPath.size()];
+
+ {
+ FieldAccessUtil.getFieldsAbvs(abvsFields, doFields, fieldPath);
+ recordType = recordType.deepCopy(recordType);
+ }
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ FieldAccessUtil.evaluate(tuple, out, eval0, abvsFields, outInput0, subRecordTmpStream, recordType);
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessUtil.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessUtil.java
new file mode 100644
index 0000000..ef790fc
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/FieldAccessUtil.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class FieldAccessUtil {
+
+ private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+ private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
+
+ @SuppressWarnings("unchecked")
+ private static ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+
+ @SuppressWarnings("unchecked")
+ public static void getFieldsAbvs(ArrayBackedValueStorage[] abvsFields, DataOutput[] doFields,
+ List<String> fieldPaths) throws AlgebricksException {
+ AString as;
+ for (int i = 0; i < fieldPaths.size(); i++) {
+ abvsFields[i] = new ArrayBackedValueStorage();
+ doFields[i] = abvsFields[i].getDataOutput();
+ as = new AString(fieldPaths.get(i));
+ try {
+ AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(as.getType()).serialize(as,
+ doFields[i]);
+ } catch (HyracksDataException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ }
+
+ public static boolean checkType(byte tagId, DataOutput out) throws AlgebricksException {
+ if (tagId == SER_NULL_TYPE_TAG) {
+ try {
+ nullSerde.serialize(ANull.NULL, out);
+ } catch (HyracksDataException e) {
+ throw new AlgebricksException(e);
+ }
+ return true;
+ }
+
+ if (tagId != SER_RECORD_TYPE_TAG) {
+ throw new AlgebricksException("Field accessor is not defined for values of type "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(tagId));
+ }
+ return false;
+ }
+
+ public static void evaluate(IFrameTupleReference tuple, DataOutput out, ICopyEvaluator eval0,
+ ArrayBackedValueStorage[] abvsFields, ArrayBackedValueStorage abvsRecord,
+ ByteArrayAccessibleOutputStream subRecordTmpStream, ARecordType recordType) throws AlgebricksException {
+
+ try {
+ abvsRecord.reset();
+ eval0.evaluate(tuple);
+
+ int subFieldIndex = -1;
+ int subFieldOffset = -1;
+ int subFieldLength = -1;
+ int nullBitmapSize = -1;
+ IAType subType = recordType;
+ ATypeTag subTypeTag = ATypeTag.NULL;
+ byte[] subRecord = abvsRecord.getByteArray();
+ boolean openField = false;
+ int i = 0;
+
+ if (checkType(subRecord[0], out)) {
+ return;
+ }
+
+ //Moving through closed fields
+ for (; i < abvsFields.length; i++) {
+ if (subType.getTypeTag().equals(ATypeTag.UNION)) {
+ //enforced SubType
+ subType = ((AUnionType) subType).getUnionList().get(AUnionType.OPTIONAL_TYPE_INDEX_IN_UNION_LIST);
+ if (subType.getTypeTag().serialize() != SER_RECORD_TYPE_TAG) {
+ throw new AlgebricksException("Field accessor is not defined for values of type " + subTypeTag);
+ }
+
+ }
+ subFieldIndex = ((ARecordType) subType).findFieldPosition(abvsFields[i].getByteArray(),
+ abvsFields[i].getStartOffset() + 1, abvsFields[i].getLength());
+ if (subFieldIndex == -1) {
+ break;
+ }
+ nullBitmapSize = ARecordType.computeNullBitmapSize((ARecordType) subType);
+ subFieldOffset = ARecordSerializerDeserializer.getFieldOffsetById(subRecord, subFieldIndex,
+ nullBitmapSize, ((ARecordType) subType).isOpen());
+ if (subFieldOffset == 0) {
+ // the field is null, we checked the null bit map
+ out.writeByte(SER_NULL_TYPE_TAG);
+ return;
+ }
+ subType = ((ARecordType) subType).getFieldTypes()[subFieldIndex];
+ if (subType.getTypeTag().equals(ATypeTag.UNION)) {
+ if (NonTaggedFormatUtil.isOptionalField((AUnionType) subType)) {
+ subTypeTag = ((AUnionType) subType).getUnionList()
+ .get(AUnionType.OPTIONAL_TYPE_INDEX_IN_UNION_LIST).getTypeTag();
+ subFieldLength = NonTaggedFormatUtil.getFieldValueLength(subRecord, subFieldOffset, subTypeTag,
+ false);
+ } else {
+ // union .. the general case
+ throw new NotImplementedException();
+ }
+ } else {
+ subTypeTag = subType.getTypeTag();
+ subFieldLength = NonTaggedFormatUtil.getFieldValueLength(subRecord, subFieldOffset, subTypeTag,
+ false);
+ }
+
+ if (i < abvsFields.length - 1) {
+ //setup next iteration
+ subRecordTmpStream.reset();
+ subRecordTmpStream.write(subTypeTag.serialize());
+ subRecordTmpStream.write(subRecord, subFieldOffset, subFieldLength);
+ subRecord = subRecordTmpStream.getByteArray();
+
+ if (checkType(subRecord[0], out)) {
+ return;
+ }
+ }
+ }
+
+ //Moving through open fields
+ for (; i < abvsFields.length; i++) {
+ openField = true;
+ subFieldOffset = ARecordSerializerDeserializer.getFieldOffsetByName(subRecord,
+ abvsFields[i].getByteArray());
+ if (subFieldOffset < 0) {
+ out.writeByte(SER_NULL_TYPE_TAG);
+ return;
+ }
+
+ subTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(subRecord[subFieldOffset]);
+ subFieldLength = NonTaggedFormatUtil.getFieldValueLength(subRecord, subFieldOffset, subTypeTag, true) + 1;
+
+ if (i < abvsFields.length - 1) {
+ //setup next iteration
+ subRecord = Arrays.copyOfRange(subRecord, subFieldOffset, subFieldOffset + subFieldLength);
+
+ if (checkType(subRecord[0], out)) {
+ return;
+ }
+ }
+ }
+ if (!openField) {
+ out.writeByte(subTypeTag.serialize());
+ }
+ out.write(subRecord, subFieldOffset, subFieldLength);
+
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ } catch (AsterixException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldValueDescriptor.java
similarity index 78%
copy from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
copy to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldValueDescriptor.java
index 9a2c19b..dfd8db0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldValueDescriptor.java
@@ -3,32 +3,31 @@
* Licensed 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 from
- *
+ *
* 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.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessByIndexEvalFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-public class FieldAccessByIndexDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class GetRecordFieldValueDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
- return new FieldAccessByIndexDescriptor();
+ return new GetRecordFieldValueDescriptor();
}
};
@@ -40,12 +39,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX;
+ return AsterixBuiltinFunctions.GET_RECORD_FIELD_VALUE;
}
@Override
public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) {
- return new FieldAccessByIndexEvalFactory(args[0], args[1], recType);
+ return new GetRecordFieldValueEvalFactory(args[0], args[1], recType);
}
-}
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java
new file mode 100644
index 0000000..b07049a
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class GetRecordFieldValueEvalFactory implements ICopyEvaluatorFactory {
+
+ private static final long serialVersionUID = 1L;
+
+ private ICopyEvaluatorFactory recordEvalFactory;
+ private ICopyEvaluatorFactory fldNameEvalFactory;
+ private ARecordType recordType;
+
+ private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
+
+ public GetRecordFieldValueEvalFactory(ICopyEvaluatorFactory recordEvalFactory,
+ ICopyEvaluatorFactory fldNameEvalFactory, ARecordType recordType) {
+ this.recordEvalFactory = recordEvalFactory;
+ this.fldNameEvalFactory = fldNameEvalFactory;
+ this.recordType = recordType;
+ }
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+
+ private DataOutput out = output.getDataOutput();
+ private ByteArrayAccessibleOutputStream subRecordTmpStream = new ByteArrayAccessibleOutputStream();
+
+ private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
+ private ArrayBackedValueStorage outInput1 = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval0 = recordEvalFactory.createEvaluator(outInput0);
+ private ICopyEvaluator eval1 = fldNameEvalFactory.createEvaluator(outInput1);
+
+ int size = 1;
+ private ArrayBackedValueStorage abvsFields[] = new ArrayBackedValueStorage[size];
+ private DataOutput[] doFields = new DataOutput[size];
+
+ @SuppressWarnings("unchecked")
+ private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+
+ {
+ abvsFields[0] = new ArrayBackedValueStorage();
+ doFields[0] = abvsFields[0].getDataOutput();
+ recordType = recordType.deepCopy(recordType);
+ }
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ try {
+ outInput1.reset();
+ eval1.evaluate(tuple);
+
+ byte[] serFldName = outInput1.getByteArray();
+ if (serFldName[0] != SER_STRING_TYPE_TAG) {
+ nullSerde.serialize(ANull.NULL, out);
+ return;
+ }
+ abvsFields[0].reset();
+ doFields[0].write(serFldName);
+
+ FieldAccessUtil.evaluate(tuple, out, eval0, abvsFields, outInput0, subRecordTmpStream, recordType);
+ } catch (IOException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldsDescriptor.java
similarity index 78%
copy from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
copy to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldsDescriptor.java
index 9a2c19b..98abc61 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByIndexDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldsDescriptor.java
@@ -3,32 +3,31 @@
* Licensed 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 from
- *
+ *
* 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.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessByIndexEvalFactory;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-public class FieldAccessByIndexDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class GetRecordFieldsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
public IFunctionDescriptor createFunctionDescriptor() {
- return new FieldAccessByIndexDescriptor();
+ return new GetRecordFieldsDescriptor();
}
};
@@ -40,12 +39,12 @@
@Override
public FunctionIdentifier getIdentifier() {
- return AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX;
+ return AsterixBuiltinFunctions.GET_RECORD_FIELDS;
}
@Override
public ICopyEvaluatorFactory createEvaluatorFactory(ICopyEvaluatorFactory[] args) {
- return new FieldAccessByIndexEvalFactory(args[0], args[1], recType);
+ return new GetRecordFieldsEvalFactory(args[0], recType);
}
-}
+}
\ No newline at end of file
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java
new file mode 100644
index 0000000..c0c77a3
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.pointables.nonvisitor.ARecordPointable;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class GetRecordFieldsEvalFactory implements ICopyEvaluatorFactory {
+
+ private static final long serialVersionUID = 1L;
+
+ private ICopyEvaluatorFactory recordEvalFactory;
+ private ARecordType recordType;
+
+ private final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+ private final byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
+
+ public GetRecordFieldsEvalFactory(ICopyEvaluatorFactory recordEvalFactory, ARecordType recordType) {
+ this.recordEvalFactory = recordEvalFactory;
+ this.recordType = recordType;
+ }
+
+ @Override
+ public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+ return new ICopyEvaluator() {
+
+ @SuppressWarnings("unchecked")
+ private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
+
+ private final ARecordPointable recordPointable = (ARecordPointable) ARecordPointable.FACTORY
+ .createPointable();
+
+ private ArrayBackedValueStorage outInput0 = new ArrayBackedValueStorage();
+ private ICopyEvaluator eval0 = recordEvalFactory.createEvaluator(outInput0);
+ private DataOutput out = output.getDataOutput();
+ private RecordFieldsUtil rfu = new RecordFieldsUtil();
+
+ {
+ recordType = recordType.deepCopy(recordType);
+ }
+
+ public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+ outInput0.reset();
+ eval0.evaluate(tuple);
+
+ if (outInput0.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+ try {
+ nullSerde.serialize(ANull.NULL, out);
+ } catch (HyracksDataException e) {
+ throw new AlgebricksException(e);
+ }
+ }
+
+ if (outInput0.getByteArray()[0] != SER_RECORD_TYPE_TAG) {
+ throw new AlgebricksException("Field accessor is not defined for values of type "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getByteArray()[0]));
+ }
+
+ recordPointable.set(outInput0.getByteArray(), outInput0.getStartOffset(), outInput0.getLength());
+
+ try {
+ rfu.processRecord(recordPointable, recordType, out, 0);
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (AsterixException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java
new file mode 100644
index 0000000..fbb9a1b
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java
@@ -0,0 +1,303 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.builders.AbvsBuilderFactory;
+import edu.uci.ics.asterix.builders.IARecordBuilder;
+import edu.uci.ics.asterix.builders.IAsterixListBuilder;
+import edu.uci.ics.asterix.builders.ListBuilderFactory;
+import edu.uci.ics.asterix.builders.OrderedListBuilder;
+import edu.uci.ics.asterix.builders.RecordBuilder;
+import edu.uci.ics.asterix.builders.RecordBuilderFactory;
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.base.AMutableString;
+import edu.uci.ics.asterix.om.base.AString;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.nonvisitor.AListPointable;
+import edu.uci.ics.asterix.om.pointables.nonvisitor.ARecordPointable;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.container.IObjectPool;
+import edu.uci.ics.asterix.om.util.container.ListObjectPool;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IMutableValueStorage;
+import edu.uci.ics.hyracks.data.std.api.IPointable;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+
+public class RecordFieldsUtil {
+
+ private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
+ private final static byte SER_ORDERED_LIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
+ private final static byte SER_UNORDERED_LIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
+
+ private final static AString fieldName = new AString("field-name");
+ private final static AString typeName = new AString("field-type");
+ private final static AString isOpenName = new AString("is-open");
+ private final static AString nestedName = new AString("nested");
+ private final static AString listName = new AString("list");
+
+ private IObjectPool<IARecordBuilder, String> recordBuilderPool = new ListObjectPool<IARecordBuilder, String>(
+ new RecordBuilderFactory());
+ private IObjectPool<IAsterixListBuilder, String> listBuilderPool = new ListObjectPool<IAsterixListBuilder, String>(
+ new ListBuilderFactory());
+ private IObjectPool<IMutableValueStorage, String> abvsBuilderPool = new ListObjectPool<IMutableValueStorage, String>(
+ new AbvsBuilderFactory());
+ private IObjectPool<IPointable, String> recordPointablePool = new ListObjectPool<IPointable, String>(
+ ARecordPointable.ALLOCATOR);
+ private IObjectPool<IPointable, String> listPointablePool = new ListObjectPool<IPointable, String>(
+ AListPointable.ALLOCATOR);
+
+ private final static AOrderedListType listType = new AOrderedListType(BuiltinType.ANY, "fields");
+ @SuppressWarnings("unchecked")
+ protected final static ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ASTRING);
+ @SuppressWarnings("unchecked")
+ protected final static ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ABOOLEAN);
+
+ private final static ARecordType openType = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
+
+ public void processRecord(ARecordPointable recordAccessor, ARecordType recType, DataOutput out, int level)
+ throws IOException, AsterixException, AlgebricksException {
+ ArrayBackedValueStorage itemValue = getTempBuffer();
+ ArrayBackedValueStorage fieldName = getTempBuffer();
+
+ OrderedListBuilder orderedListBuilder = getOrderedListBuilder();
+ orderedListBuilder.reset(listType);
+ IARecordBuilder fieldRecordBuilder = getRecordBuilder();
+ fieldRecordBuilder.reset(null);
+
+ int schemeFieldCount = recordAccessor.getSchemeFieldCount(recType);
+ for (int i = 0; i < schemeFieldCount; ++i) {
+ itemValue.reset();
+ fieldRecordBuilder.init();
+
+ // write name
+ fieldName.reset();
+ recordAccessor.getClosedFieldName(recType, i, fieldName.getDataOutput());
+ addNameField(fieldName, fieldRecordBuilder);
+
+ // write type
+ byte tag = recordAccessor.getClosedFieldTag(recType, i);
+ addFieldType(tag, fieldRecordBuilder);
+
+ // write open
+ addIsOpenField(false, fieldRecordBuilder);
+
+ // write nested or list types
+ if (tag == SER_RECORD_TYPE_TAG || tag == SER_ORDERED_LIST_TYPE_TAG || tag == SER_UNORDERED_LIST_TYPE_TAG) {
+ if (!recordAccessor.isClosedFieldNull(recType, i)) {
+ IAType fieldType = recordAccessor.getClosedFieldType(recType, i);
+ ArrayBackedValueStorage tmpValue = getTempBuffer();
+ tmpValue.reset();
+ recordAccessor.getClosedFieldValue(recType, i, tmpValue.getDataOutput());
+ if (tag == SER_RECORD_TYPE_TAG) {
+ addNestedField(tmpValue, fieldType, fieldRecordBuilder, level + 1);
+ } else if (tag == SER_ORDERED_LIST_TYPE_TAG || tag == SER_UNORDERED_LIST_TYPE_TAG) {
+ addListField(tmpValue, fieldType, fieldRecordBuilder, level + 1);
+ }
+ }
+ }
+
+ // write record
+ fieldRecordBuilder.write(itemValue.getDataOutput(), true);
+
+ // add item to the list of fields
+ orderedListBuilder.addItem(itemValue);
+ }
+ for (int i = recordAccessor.getOpenFieldCount(recType) - 1; i >= 0; --i) {
+ itemValue.reset();
+ fieldRecordBuilder.init();
+
+ // write name
+ fieldName.reset();
+ recordAccessor.getOpenFieldName(recType, i, fieldName.getDataOutput());
+ addNameField(fieldName, fieldRecordBuilder);
+
+ // write type
+ byte tag = recordAccessor.getOpenFieldTag(recType, i);
+ addFieldType(tag, fieldRecordBuilder);
+
+ // write open
+ addIsOpenField(true, fieldRecordBuilder);
+
+ // write nested or list types
+ if (tag == SER_RECORD_TYPE_TAG || tag == SER_ORDERED_LIST_TYPE_TAG || tag == SER_UNORDERED_LIST_TYPE_TAG) {
+ IAType fieldType = null;
+ ArrayBackedValueStorage tmpValue = getTempBuffer();
+ tmpValue.reset();
+ recordAccessor.getOpenFieldValue(recType, i, tmpValue.getDataOutput());
+ if (tag == SER_RECORD_TYPE_TAG) {
+ addNestedField(tmpValue, fieldType, fieldRecordBuilder, level + 1);
+ } else if (tag == SER_ORDERED_LIST_TYPE_TAG || tag == SER_UNORDERED_LIST_TYPE_TAG) {
+ addListField(tmpValue, fieldType, fieldRecordBuilder, level + 1);
+ }
+ }
+
+ // write record
+ fieldRecordBuilder.write(itemValue.getDataOutput(), true);
+
+ // add item to the list of fields
+ orderedListBuilder.addItem(itemValue);
+ }
+ orderedListBuilder.write(out, true);
+ }
+
+ public void addNameField(IValueReference nameArg, IARecordBuilder fieldRecordBuilder)
+ throws HyracksDataException, AsterixException {
+ ArrayBackedValueStorage fieldAbvs = getTempBuffer();
+
+ fieldAbvs.reset();
+ stringSerde.serialize(fieldName, fieldAbvs.getDataOutput());
+ fieldRecordBuilder.addField(fieldAbvs, nameArg);
+ }
+
+ public void addFieldType(byte tagId, IARecordBuilder fieldRecordBuilder) throws HyracksDataException,
+ AsterixException {
+ ArrayBackedValueStorage fieldAbvs = getTempBuffer();
+ ArrayBackedValueStorage valueAbvs = getTempBuffer();
+
+ // Name
+ fieldAbvs.reset();
+ stringSerde.serialize(typeName, fieldAbvs.getDataOutput());
+ // Value
+ valueAbvs.reset();
+ ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(tagId);
+ AMutableString aString = new AMutableString("");
+ aString.setValue(tag.toString());
+ stringSerde.serialize(aString, valueAbvs.getDataOutput());
+ fieldRecordBuilder.addField(fieldAbvs, valueAbvs);
+ }
+
+ public void addIsOpenField(boolean isOpen, IARecordBuilder fieldRecordBuilder) throws HyracksDataException,
+ AsterixException {
+ ArrayBackedValueStorage fieldAbvs = getTempBuffer();
+ ArrayBackedValueStorage valueAbvs = getTempBuffer();
+
+ // Name
+ fieldAbvs.reset();
+ stringSerde.serialize(isOpenName, fieldAbvs.getDataOutput());
+ // Value
+ valueAbvs.reset();
+ if (isOpen) {
+ booleanSerde.serialize(ABoolean.TRUE, valueAbvs.getDataOutput());
+ } else {
+ booleanSerde.serialize(ABoolean.FALSE, valueAbvs.getDataOutput());
+ }
+ fieldRecordBuilder.addField(fieldAbvs, valueAbvs);
+ }
+
+ public void addListField(IValueReference listArg, IAType fieldType, IARecordBuilder fieldRecordBuilder,
+ int level) throws AsterixException, IOException, AlgebricksException {
+ ArrayBackedValueStorage fieldAbvs = getTempBuffer();
+ ArrayBackedValueStorage valueAbvs = getTempBuffer();
+
+ // Name
+ fieldAbvs.reset();
+ stringSerde.serialize(listName, fieldAbvs.getDataOutput());
+ // Value
+ valueAbvs.reset();
+ processListValue(listArg, fieldType, valueAbvs.getDataOutput(), level);
+ fieldRecordBuilder.addField(fieldAbvs, valueAbvs);
+ }
+
+ public void addNestedField(IValueReference recordArg, IAType fieldType, IARecordBuilder fieldRecordBuilder,
+ int level) throws HyracksDataException, AlgebricksException, IOException, AsterixException {
+ ArrayBackedValueStorage fieldAbvs = getTempBuffer();
+ ArrayBackedValueStorage valueAbvs = getTempBuffer();
+
+ // Name
+ fieldAbvs.reset();
+ stringSerde.serialize(nestedName, fieldAbvs.getDataOutput());
+ // Value
+ valueAbvs.reset();
+ ARecordType newType;
+ if (fieldType == null) {
+ newType = openType.deepCopy(openType);
+ } else {
+ newType = ((ARecordType) fieldType).deepCopy((ARecordType) fieldType);
+ }
+ ARecordPointable recordP = getRecordPointable();
+ recordP.set(recordArg);
+ processRecord(recordP, (ARecordType) newType, valueAbvs.getDataOutput(), level);
+ fieldRecordBuilder.addField(fieldAbvs, valueAbvs);
+ }
+
+ public void processListValue(IValueReference listArg, IAType fieldType, DataOutput out, int level)
+ throws AsterixException, IOException, AlgebricksException {
+ ArrayBackedValueStorage itemValue = getTempBuffer();
+ IARecordBuilder listRecordBuilder = getRecordBuilder();
+
+ AListPointable list = getListPointable();
+ list.set(listArg);
+
+ OrderedListBuilder innerListBuilder = getOrderedListBuilder();
+ innerListBuilder.reset(listType);
+
+ listRecordBuilder.reset(null);
+ AbstractCollectionType act = (AbstractCollectionType) fieldType;
+ int itemCount = list.getItemCount();
+ for (int l = 0; l < itemCount; l++) {
+ itemValue.reset();
+ listRecordBuilder.init();
+
+ byte tagId = list.getItemTag(act, l);
+ addFieldType(tagId, listRecordBuilder);
+
+ if (tagId == SER_RECORD_TYPE_TAG) {
+ ArrayBackedValueStorage tmpAbvs = getTempBuffer();
+ list.getItemValue(act, l, tmpAbvs.getDataOutput());
+ addNestedField(tmpAbvs, act.getItemType(), listRecordBuilder, level + 1);
+ }
+
+ listRecordBuilder.write(itemValue.getDataOutput(), true);
+ innerListBuilder.addItem(itemValue);
+ }
+ innerListBuilder.write(out, true);
+ }
+
+ private ARecordPointable getRecordPointable() {
+ return (ARecordPointable) recordPointablePool.allocate("record");
+ }
+
+ private AListPointable getListPointable() {
+ return (AListPointable) listPointablePool.allocate("list");
+ }
+
+ private IARecordBuilder getRecordBuilder() {
+ return (RecordBuilder) recordBuilderPool.allocate("record");
+ }
+
+ private OrderedListBuilder getOrderedListBuilder() {
+ return (OrderedListBuilder) listBuilderPool.allocate("ordered");
+ }
+
+ private ArrayBackedValueStorage getTempBuffer() {
+ return (ArrayBackedValueStorage) abvsBuilderPool.allocate("buffer");
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RecordMergeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
similarity index 94%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RecordMergeDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
index bc09690..dfe9200 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RecordMergeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.evaluators.functions;
+package edu.uci.ics.asterix.runtime.evaluators.functions.records;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
@@ -27,7 +27,7 @@
import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
-import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordVisitablePointable;
import edu.uci.ics.asterix.om.pointables.PointableAllocator;
import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.om.typecomputer.impl.RecordMergeTypeComputer;
@@ -138,8 +138,8 @@
vp0.set(abvs0);
vp1.set(abvs1);
- ARecordPointable rp0 = (ARecordPointable) vp0;
- ARecordPointable rp1 = (ARecordPointable) vp1;
+ ARecordVisitablePointable rp0 = (ARecordVisitablePointable) vp0;
+ ARecordVisitablePointable rp1 = (ARecordVisitablePointable) vp1;
try {
mergeFields(recType, rp0, rp1, true, 0);
@@ -150,8 +150,8 @@
}
}
- private void mergeFields(ARecordType combinedType, ARecordPointable leftRecord,
- ARecordPointable rightRecord, boolean openFromParent, int nestedLevel) throws IOException,
+ private void mergeFields(ARecordType combinedType, ARecordVisitablePointable leftRecord,
+ ARecordVisitablePointable rightRecord, boolean openFromParent, int nestedLevel) throws IOException,
AsterixException, AlgebricksException {
if (rbStack.size() < (nestedLevel + 1)) {
rbStack.push(new RecordBuilder());
@@ -182,11 +182,9 @@
}
}
if (!foundMatch) {
-
addFieldToSubRecord(combinedType, leftName, leftValue, null, openFromParent,
nestedLevel);
}
-
}
//Repeat for right side (ignoring duplicates this time)
for (int j = 0; j < rightRecord.getFieldNames().size(); j++) {
@@ -203,9 +201,7 @@
addFieldToSubRecord(combinedType, rightName, rightValue, null, openFromParent,
nestedLevel);
}
-
}
-
}
//Takes in a record type, field name, and the field values (which are record) from two records
@@ -229,9 +225,8 @@
rbStack.get(nestedLevel).addField(pos, leftValue);
} else {
mergeFields((ARecordType) combinedType.getFieldType(fieldName),
- (ARecordPointable) leftValue, (ARecordPointable) rightValue, false,
+ (ARecordVisitablePointable) leftValue, (ARecordVisitablePointable) rightValue, false,
nestedLevel + 1);
-
tabvs.reset();
rbStack.get(nestedLevel + 1).write(tabvs.getDataOutput(), true);
rbStack.get(nestedLevel).addField(pos, tabvs);
@@ -241,7 +236,7 @@
rbStack.get(nestedLevel).addField(fieldNamePointable, leftValue);
} else {
mergeFields((ARecordType) combinedType.getFieldType(fieldName),
- (ARecordPointable) leftValue, (ARecordPointable) rightValue, false,
+ (ARecordVisitablePointable) leftValue, (ARecordVisitablePointable) rightValue, false,
nestedLevel + 1);
tabvs.reset();
rbStack.get(nestedLevel + 1).write(tabvs.getDataOutput(), true);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
index 8fdd14c..29d2afd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
@@ -134,8 +134,6 @@
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalSecondAccessor;
import edu.uci.ics.asterix.runtime.evaluators.accessors.TemporalYearAccessor;
import edu.uci.ics.asterix.runtime.evaluators.common.CreateMBREvalFactory;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessByIndexEvalFactory;
-import edu.uci.ics.asterix.runtime.evaluators.common.FieldAccessNestedEvalFactory;
import edu.uci.ics.asterix.runtime.evaluators.common.FunctionManagerImpl;
import edu.uci.ics.asterix.runtime.evaluators.constructors.ABinaryBase64StringConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.constructors.ABinaryHexStringConstructorDescriptor;
@@ -166,11 +164,12 @@
import edu.uci.ics.asterix.runtime.evaluators.constructors.AStringConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.constructors.ATimeConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.constructors.AYearMonthDurationConstructorDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.constructors.ClosedRecordConstructorDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.constructors.OpenRecordConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.AndDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.AnyCollectionMemberDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CastListDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CastRecordDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.ClosedRecordConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CodePointToStringDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.ContainsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CountHashedGramTokensDescriptor;
@@ -189,9 +188,6 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.EditDistanceStringIsFilterable;
import edu.uci.ics.asterix.runtime.evaluators.functions.EmbedTypeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.EndsWithDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.FieldAccessByIndexDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.FieldAccessByNameDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.FieldAccessNestedDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.FlowRecordDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.FuzzyEqDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.GetItemDescriptor;
@@ -218,11 +214,9 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEvenDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericSubDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericUnaryMinusDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.OpenRecordConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.OrDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.OrderedListConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.PrefixLenJaccardDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.RecordMergeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.RegExpDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.SimilarityJaccardCheckDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.SimilarityJaccardDescriptor;
@@ -263,6 +257,14 @@
import edu.uci.ics.asterix.runtime.evaluators.functions.binary.PrintBinaryDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.binary.SubBinaryFromDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.binary.SubBinaryFromToDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.FieldAccessByIndexDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.FieldAccessByIndexEvalFactory;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.FieldAccessByNameDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.FieldAccessNestedDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.FieldAccessNestedEvalFactory;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.GetRecordFieldValueDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.GetRecordFieldsDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.records.RecordMergeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AdjustDateTimeForTimeZoneDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AdjustTimeForTimeZoneDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CalendarDuartionFromDateDescriptor;
@@ -409,6 +411,9 @@
temp.add(FieldAccessByIndexDescriptor.FACTORY);
temp.add(FieldAccessByNameDescriptor.FACTORY);
temp.add(FieldAccessNestedDescriptor.FACTORY);
+ temp.add(GetRecordFieldsDescriptor.FACTORY);
+ temp.add(GetRecordFieldValueDescriptor.FACTORY);
+ temp.add(FieldAccessByNameDescriptor.FACTORY);
temp.add(GetItemDescriptor.FACTORY);
temp.add(NumericUnaryMinusDescriptor.FACTORY);
temp.add(OpenRecordConstructorDescriptor.FACTORY);
@@ -759,13 +764,10 @@
throw new AlgebricksException(e);
}
}
- ICopyEvaluatorFactory fldNameEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
- abvs.getLength()));
ICopyEvaluatorFactory[] factories = new ICopyEvaluatorFactory[2];
factories[0] = recordEvalFactory;
- factories[1] = fldNameEvalFactory;
if (fldName.size() > 1) {
- evalFactory = new FieldAccessNestedEvalFactory(recordEvalFactory, fldNameEvalFactory, recType, fldName);
+ evalFactory = new FieldAccessNestedEvalFactory(recordEvalFactory, recType, fldName);
} else {
evalFactory = FieldAccessByNameDescriptor.FACTORY.createFunctionDescriptor().createEvaluatorFactory(
factories);
@@ -861,10 +863,7 @@
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
- ICopyEvaluatorFactory fldNameEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
- abvs.getLength()));
- ICopyEvaluatorFactory evalFactory = new FieldAccessNestedEvalFactory(recordEvalFactory, fldNameEvalFactory,
- recType, fldName);
+ ICopyEvaluatorFactory evalFactory = new FieldAccessNestedEvalFactory(recordEvalFactory, recType, fldName);
IFunctionInfo finfoAccess = AsterixBuiltinFunctions
.getAsterixFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_NESTED);
@@ -1004,6 +1003,26 @@
}
}
}
+ if (fd.getIdentifier().equals(AsterixBuiltinFunctions.GET_RECORD_FIELDS)) {
+ AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
+ IAType t = (IAType) context.getType(fce.getArguments().get(0).getValue());
+ if (t.getTypeTag().equals(ATypeTag.RECORD)) {
+ ARecordType recType = (ARecordType) t;
+ ((GetRecordFieldsDescriptor) fd).reset(recType);
+ } else {
+ throw new NotImplementedException("get-record-fields for data of type " + t);
+ }
+ }
+ if (fd.getIdentifier().equals(AsterixBuiltinFunctions.GET_RECORD_FIELD_VALUE)) {
+ AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
+ IAType t = (IAType) context.getType(fce.getArguments().get(0).getValue());
+ if (t.getTypeTag().equals(ATypeTag.RECORD)) {
+ ARecordType recType = (ARecordType) t;
+ ((GetRecordFieldValueDescriptor) fd).reset(recType);
+ } else {
+ throw new NotImplementedException("get-record-field-value for data of type " + t);
+ }
+ }
}
private boolean[] computeOpenFields(AbstractFunctionCallExpression expr, ARecordType recType) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java
index 7e6ff04..1bdd264 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/ADMDataParser.java
@@ -17,15 +17,16 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayDeque;
import java.util.BitSet;
import java.util.List;
-import java.util.Queue;
+import edu.uci.ics.asterix.builders.AbvsBuilderFactory;
import edu.uci.ics.asterix.builders.IARecordBuilder;
import edu.uci.ics.asterix.builders.IAsterixListBuilder;
+import edu.uci.ics.asterix.builders.ListBuilderFactory;
import edu.uci.ics.asterix.builders.OrderedListBuilder;
import edu.uci.ics.asterix.builders.RecordBuilder;
+import edu.uci.ics.asterix.builders.RecordBuilderFactory;
import edu.uci.ics.asterix.builders.UnorderedListBuilder;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
@@ -41,11 +42,13 @@
import edu.uci.ics.asterix.om.types.hierachy.ATypeHierarchy;
import edu.uci.ics.asterix.om.types.hierachy.ITypeConvertComputer;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.asterix.om.util.container.IObjectPool;
+import edu.uci.ics.asterix.om.util.container.ListObjectPool;
import edu.uci.ics.asterix.runtime.operators.file.adm.AdmLexer;
import edu.uci.ics.asterix.runtime.operators.file.adm.AdmLexerException;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IMutableValueStorage;
import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.marshalling.Integer64SerializerDeserializer;
/**
* Parser for ADM formatted data.
@@ -59,10 +62,12 @@
private int nullableFieldId = 0;
private ArrayBackedValueStorage castBuffer = new ArrayBackedValueStorage();
- private Queue<ArrayBackedValueStorage> baaosPool = new ArrayDeque<ArrayBackedValueStorage>();
- private Queue<IARecordBuilder> recordBuilderPool = new ArrayDeque<IARecordBuilder>();
- private Queue<IAsterixListBuilder> orderedListBuilderPool = new ArrayDeque<IAsterixListBuilder>();
- private Queue<IAsterixListBuilder> unorderedListBuilderPool = new ArrayDeque<IAsterixListBuilder>();
+ private IObjectPool<IARecordBuilder, String> recordBuilderPool = new ListObjectPool<IARecordBuilder, String>(
+ new RecordBuilderFactory());
+ private IObjectPool<IAsterixListBuilder, String> listBuilderPool = new ListObjectPool<IAsterixListBuilder, String>(
+ new ListBuilderFactory());
+ private IObjectPool<IMutableValueStorage, String> abvsBuilderPool = new ListObjectPool<IMutableValueStorage, String>(
+ new AbvsBuilderFactory());
private String mismatchErrorMessage = "Mismatch Type, expecting a value of type ";
private String mismatchErrorMessage2 = " got a value of type ";
@@ -637,9 +642,6 @@
}
}
recBuilder.write(out, true);
- returnRecordBuilder(recBuilder);
- returnTempBuffer(fieldNameBuffer);
- returnTempBuffer(fieldValueBuffer);
}
private int checkNullConstraints(ARecordType recType, BitSet nulls) {
@@ -708,8 +710,6 @@
first = false;
} while (inList);
orderedListBuilder.write(out, true);
- returnOrderedListBuilder(orderedListBuilder);
- returnTempBuffer(itemBuffer);
}
private void parseUnorderedList(AUnorderedListType uoltype, DataOutput out) throws IOException, AsterixException,
@@ -757,60 +757,22 @@
first = false;
} while (inList);
unorderedListBuilder.write(out, true);
- returnUnorderedListBuilder(unorderedListBuilder);
- returnTempBuffer(itemBuffer);
}
private IARecordBuilder getRecordBuilder() {
- RecordBuilder recBuilder = (RecordBuilder) recordBuilderPool.poll();
- if (recBuilder != null) {
- return recBuilder;
- } else {
- return new RecordBuilder();
- }
- }
-
- private void returnRecordBuilder(IARecordBuilder recBuilder) {
- this.recordBuilderPool.add(recBuilder);
+ return (RecordBuilder) recordBuilderPool.allocate("record");
}
private IAsterixListBuilder getOrderedListBuilder() {
- OrderedListBuilder orderedListBuilder = (OrderedListBuilder) orderedListBuilderPool.poll();
- if (orderedListBuilder != null) {
- return orderedListBuilder;
- } else {
- return new OrderedListBuilder();
- }
- }
-
- private void returnOrderedListBuilder(IAsterixListBuilder orderedListBuilder) {
- this.orderedListBuilderPool.add(orderedListBuilder);
+ return listBuilderPool.allocate("ordered");
}
private IAsterixListBuilder getUnorderedListBuilder() {
- UnorderedListBuilder unorderedListBuilder = (UnorderedListBuilder) unorderedListBuilderPool.poll();
- if (unorderedListBuilder != null) {
- return unorderedListBuilder;
- } else {
- return new UnorderedListBuilder();
- }
- }
-
- private void returnUnorderedListBuilder(IAsterixListBuilder unorderedListBuilder) {
- this.unorderedListBuilderPool.add(unorderedListBuilder);
+ return listBuilderPool.allocate("unordered");
}
private ArrayBackedValueStorage getTempBuffer() {
- ArrayBackedValueStorage tmpBaaos = baaosPool.poll();
- if (tmpBaaos != null) {
- return tmpBaaos;
- } else {
- return new ArrayBackedValueStorage();
- }
- }
-
- private void returnTempBuffer(ArrayBackedValueStorage tempBaaos) {
- baaosPool.add(tempBaaos);
+ return (ArrayBackedValueStorage) abvsBuilderPool.allocate("buffer");
}
private void parseToBinaryTarget(int lexerToken, String tokenImage, DataOutput out) throws ParseException,
diff --git a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
index dbd12cd..3167a17 100644
--- a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
+++ b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
@@ -77,6 +77,7 @@
public static final String DEFAULT_TESTSUITE_XML_NAME = "testsuite.xml";
public static final String ONLY_TESTSUITE_XML_NAME = "only.xml";
+ public static final String DEFAULT_REPEADED_TESTSUITE_XML_NAME = "repeatedtestsuite.xml";
private File tsRoot;
diff --git a/pom.xml b/pom.xml
index dbf53ac..6f4217e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,12 +24,12 @@
<packaging>pom</packaging>
<licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- <comments>A business-friendly OSS license</comments>
- </license>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ <comments>A business-friendly OSS license</comments>
+ </license>
</licenses>
<properties>
@@ -41,9 +41,10 @@
<optimizer.tests>**/optimizer/**/*Test.java</optimizer.tests>
<metadata.tests>**/metadata/*Test.java</metadata.tests>
<execution.tests>**/ExecutionTest.java</execution.tests>
+ <repeated.tests>**/ExecutionTest.java</repeated.tests>
<invalid.tests>**/DmlTest.java</invalid.tests>
<global.test.includes>**/*TestSuite.java,**/*Test.java,${execution.tests}</global.test.includes>
- <global.test.excludes>${optimizer.tests},${metadata.tests},${invalid.tests}</global.test.excludes>
+ <global.test.excludes>${optimizer.tests},${metadata.tests},${invalid.tests},${repeated.tests}</global.test.excludes>
<!-- Versions under dependencymanagement or used in many projects via properties -->
<algebricks.version>0.2.16-SNAPSHOT</algebricks.version>
<hyracks.version>0.2.16-SNAPSHOT</hyracks.version>
@@ -89,59 +90,60 @@
</excludes>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.11</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <excludeSubProjects>true</excludeSubProjects>
- <licenses>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>MIT</licenseFamilyCategory>
- <licenseFamilyName>The MIT License</licenseFamilyName>
- <notes>For JQuery MIT/GPL2 Dual License</notes>
- <patterns>
- <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
- <pattern>Dual licensed under the MIT and GPL2 licenses.</pattern>
- <pattern>http://jquery.org/license</pattern>
- <pattern>Dual licensed under the MIT</pattern>
- <pattern>Released under the MIT license by IOLA, December 2007.</pattern>
- </patterns>
- </license>
- </licenses>
- <licenseFamilies>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>The MIT License</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>Apache License Version 2.0</familyName>
- </licenseFamily>
- </licenseFamilies>
- <excludes>
- <exclude>**/*.txt</exclude>
- <exclude>**/*.tbl</exclude>
- <exclude>**/*.tsv</exclude>
- <exclude>**/*.ddl</exclude>
- <exclude>**/*.aql</exclude>
- <exclude>**/*.adm</exclude>
- <exclude>**/*.csv</exclude>
- <exclude>**/*.out</exclude>
- <exclude>**/*.iml</exclude>
- </excludes>
- <includes>
- <include>**/asterix-*</include>
- <include>**/*.java</include>
- </includes>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.11</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <excludeSubProjects>true</excludeSubProjects>
+ <licenses>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>MIT</licenseFamilyCategory>
+ <licenseFamilyName>The MIT License</licenseFamilyName>
+ <notes>For JQuery MIT/GPL2 Dual License</notes>
+ <patterns>
+ <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
+ <pattern>Dual licensed under the MIT and GPL2 licenses.</pattern>
+ <pattern>http://jquery.org/license</pattern>
+ <pattern>Dual licensed under the MIT</pattern>
+ <pattern>Released under the MIT license by IOLA, December 2007.</pattern>
+ </patterns>
+ </license>
+ </licenses>
+ <licenseFamilies>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>The MIT License</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>Apache License Version 2.0</familyName>
+ </licenseFamily>
+ </licenseFamilies>
+ <excludes>
+ <exclude>**/*.adm</exclude>
+ <exclude>**/*.aql</exclude>
+ <exclude>**/*.csv</exclude>
+ <exclude>**/*.ddl</exclude>
+ <exclude>**/*.iml</exclude>
+ <exclude>**/*.out</exclude>
+ <exclude>**/*.tbl</exclude>
+ <exclude>**/*.tsv</exclude>
+ <exclude>**/*.txt</exclude>
+ <exclude>**/*.xsd</exclude>
+ </excludes>
+ <includes>
+ <include>**/asterix-*</include>
+ <include>**/*.java</include>
+ </includes>
+ </configuration>
+ </plugin>
</plugins>
</build>
@@ -380,9 +382,7 @@
</dependency>
<dependency>
<groupId>edu.uci.ics.hyracks</groupId>
- <artifactId>
- hyracks-storage-am-invertedindex
- </artifactId>
+ <artifactId>hyracks-storage-am-invertedindex</artifactId>
<version>${hyracks.version}</version>
</dependency>
<dependency>