diff --git a/asterix-aql/src/main/javacc/AQL.jj b/asterix-aql/src/main/javacc/AQL.jj
index 4d181ee..0d797a1 100644
--- a/asterix-aql/src/main/javacc/AQL.jj
+++ b/asterix-aql/src/main/javacc/AQL.jj
@@ -623,7 +623,7 @@
   Identifier dataverseName = null;
   Identifier datasetName = null;
   boolean alreadySorted = false;
-  String adapterClassname;
+  String adapterName;
   Map<String,String> properties;
   Pair<Identifier,Identifier> nameComponents = null;
 }
@@ -636,12 +636,11 @@
    }
    
    "using"
-
-    <STRING_LITERAL>
+  
     {
-      adapterClassname = removeQuotesAndEscapes(token.image);
+    	adapterName = getAdapterName();
     }
-
+   
     {
       properties = getConfiguration();
     }
@@ -652,11 +651,31 @@
         
   ";"
   {
-     return new LoadFromFileStatement(dataverseName, datasetName, adapterClassname, properties, alreadySorted);
+     return new LoadFromFileStatement(dataverseName, datasetName, adapterName, properties, alreadySorted);
   }   
 }
 
 
+String getAdapterName() throws ParseException :
+{
+	String adapterName = null;
+}
+{
+    ( 
+      <IDENTIFIER> {
+     	adapterName = (new Identifier(token.image)).getValue();; 
+      }
+      | 
+      <STRING_LITERAL>
+      {
+        adapterName = removeQuotesAndEscapes(token.image);
+      }
+    )
+    {
+	return adapterName;
+	}
+}
+
 
 DatasetDecl DatasetDeclaration(DatasetType datasetType) throws ParseException :
 {
@@ -721,21 +740,16 @@
 InternalDetailsDecl InternalDatasetDeclaration() throws ParseException :
 {
     InternalDetailsDecl idd = null;
-    List<String> partitioningExprs = new ArrayList<String>();
+    List<String> primaryKey = new ArrayList<String>();
     Identifier nodeGroupName=null;
 }
 {
-  "partitioned" "by" "key"
-  < IDENTIFIER >
-  {
-         partitioningExprs.add(token.image); 
-  }
   (
-    "," < IDENTIFIER >
     {
-         partitioningExprs.add(token.image); 
+  	  primaryKey = getPrimaryKey();
     }
-  )*
+  )
+  
   (
   "on" < IDENTIFIER >
     {
@@ -744,7 +758,7 @@
   )?
   
   {
-    idd = new InternalDetailsDecl(nodeGroupName, partitioningExprs);
+    idd = new InternalDetailsDecl(nodeGroupName, primaryKey);
     return idd;
   }
 }
@@ -752,7 +766,7 @@
 ExternalDetailsDecl ExternalDatasetDeclaration() throws ParseException :
 {
   ExternalDetailsDecl edd = null;
-  String adapterClassname = null;
+  String adapterName = null;
   Map < String, String > properties;
 }
 {
@@ -761,10 +775,8 @@
   }
  
     "using"
-    
-     <STRING_LITERAL>
     {
-      adapterClassname = removeQuotesAndEscapes(token.image);
+    	adapterName = getAdapterName();
     }
 
     {
@@ -773,7 +785,7 @@
 
     {
     	  edd = new ExternalDetailsDecl();
-		  edd.setAdapter(adapterClassname);
+		  edd.setAdapter(adapterName);
    		  edd.setProperties(properties);
     } 
  
@@ -785,10 +797,10 @@
 FeedDetailsDecl FeedDatasetDeclaration() throws ParseException :
 {
     FeedDetailsDecl fdd = null;
-    String adapterFactoryClassname = null;
+    String adapterName = null;
     Map < String, String > properties;
 	Pair<Identifier,Identifier> nameComponents;
-	List<String> partitioningExprs = new ArrayList<String>();
+	List<String> primaryKey = new ArrayList<String>();
     Identifier nodeGroupName=null;
     FunctionSignature appliedFunction=null;
 	String dataverse;
@@ -797,10 +809,8 @@
 }
 {
    "using"
-   
-    <STRING_LITERAL>
     {
-      adapterFactoryClassname = removeQuotesAndEscapes(token.image);
+    	adapterName = getAdapterName();
     }
 
     {
@@ -824,17 +834,12 @@
   }   
   )?
   
-  "partitioned" "by" "key"
-  < IDENTIFIER >
-  {
-    	 partitioningExprs.add(token.image);
-  }
   (
-    "," < IDENTIFIER >
     {
-    	 partitioningExprs.add(token.image);
+  	  primaryKey  = getPrimaryKey();
     }
-  )*
+  )
+  
   (
   "on" < IDENTIFIER >
   {
@@ -843,11 +848,38 @@
   )?
   
   {
-    fdd = new FeedDetailsDecl(adapterFactoryClassname, properties, appliedFunction, nodeGroupName, partitioningExprs);
+    fdd = new FeedDetailsDecl(adapterName, properties, appliedFunction, nodeGroupName, primaryKey);
     return fdd;
   }
 }
 
+List<String> getPrimaryKey()  throws ParseException :
+{
+	List<String> primaryKey = new ArrayList<String>();
+}
+{
+
+  "primary" "key"
+  < IDENTIFIER >
+  {
+    	 primaryKey.add(token.image);
+  }
+  (
+    "," < IDENTIFIER >
+    {
+    	 primaryKey.add(token.image);
+    }
+  )*
+  {
+   	return primaryKey;
+  }
+  
+}
+
+
+
+
+
 ControlFeedStatement ControlFeedDeclaration(ControlFeedStatement.OperationType operationType) throws ParseException :
 {
   Pair<Identifier,Identifier> nameComponents = null;
