Changed metadata storage format for nullable field types.
Moved field name generation to the client out of metadata node code.
Changed naming scheme for autogenerated types.
Moved GroupName, CompactionPolicy & CompactionPolicyProperties fields
up from External\InternalDetails to Dataset record type definition

Change-Id: I223aded8aaf80f0688358899c0e8b0d6988fac93
Reviewed-on: https://asterix-gerrit.ics.uci.edu/323
Reviewed-by: Till Westmann <tillw@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterix-aql/src/main/javacc/AQL.jj b/asterix-aql/src/main/javacc/AQL.jj
index 7044962..52d2b83 100644
--- a/asterix-aql/src/main/javacc/AQL.jj
+++ b/asterix-aql/src/main/javacc/AQL.jj
@@ -427,12 +427,12 @@
         ExternalDetailsDecl edd = new ExternalDetailsDecl();
         edd.setAdapter(adapterName);
         edd.setProperties(properties);
-        edd.setNodegroupName(nodeGroupName != null? new Identifier(nodeGroupName): null);
-        edd.setCompactionPolicy(compactionPolicy);
-        edd.setCompactionPolicyProperties(compactionPolicyProperties);
         dsetDecl = new DatasetDecl(nameComponents.first,
                                    nameComponents.second,
                                    new Identifier(typeName),
+                                   nodeGroupName != null? new Identifier(nodeGroupName): null,
+                                   compactionPolicy,
+                                   compactionPolicyProperties,
                                    hints,
                                    DatasetType.EXTERNAL,
                                    edd,
@@ -453,18 +453,16 @@
     ( "using" "compaction" "policy" compactionPolicy = CompactionPolicy() (compactionPolicyProperties = Configuration())? )?
     ( "with filter on" filterField = NestedField() )?
       {
-        InternalDetailsDecl idd = new InternalDetailsDecl(nodeGroupName != null
-                                                            ? new Identifier(nodeGroupName)
-                                                            : null,
-                                                          primaryKeyFields,
+        InternalDetailsDecl idd = new InternalDetailsDecl(primaryKeyFields,
                                                           autogenerated,
-                                                          compactionPolicy,
-                                                          compactionPolicyProperties,
                                                           filterField,
                                                           temp);
         dsetDecl = new DatasetDecl(nameComponents.first,
                                    nameComponents.second,
                                    new Identifier(typeName),
+                                   nodeGroupName != null ? new Identifier(nodeGroupName) : null,
+                                   compactionPolicy,
+                                   compactionPolicyProperties,
                                    hints,
                                    DatasetType.INTERNAL,
                                    idd,