>From Peeyush Gupta <[email protected]>:

Peeyush Gupta has submitted this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17954 )

Change subject: [NO ISSUE][OTH] Refactor function to validate partitioning expr
......................................................................

[NO ISSUE][OTH] Refactor function to validate partitioning expr

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

Change-Id: I07630be15f25cd140437e870cdeb4a7523363457
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17954
Integration-Tests: Jenkins <[email protected]>
Reviewed-by: Peeyush Gupta <[email protected]>
Reviewed-by: Murtadha Hubail <[email protected]>
Tested-by: Peeyush Gupta <[email protected]>
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
M 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
2 files changed, 28 insertions(+), 10 deletions(-)

Approvals:
  Murtadha Hubail: Looks good to me, approved
  Peeyush Gupta: Looks good to me, but someone else must approve; Verified
  Jenkins: Verified




diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
index 77c1a9d..e253e07 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
@@ -107,6 +107,7 @@
      * @param keySourceIndicators the key sources (record vs. meta)
      * @param autogenerated       true if auto generated, false otherwise
      * @param sourceLoc
+     * @param partitioningExprTypes types of partitioning keys
      * @return a list of partitioning expressions types
      * @throws AlgebricksException if composite key is autogenerated.
      *                             if autogenerated and of a type that can't 
be autogenerated.
@@ -116,13 +117,6 @@
      */
     public static List<IAType> validatePartitioningExpressions(ARecordType 
recType, ARecordType metaRecType,
             List<List<String>> partitioningExprs, List<Integer> 
keySourceIndicators, boolean autogenerated,
-            SourceLocation sourceLoc) throws AlgebricksException {
-        return validatePartitioningExpressionsImpl(recType, metaRecType, 
partitioningExprs, keySourceIndicators,
-                autogenerated, true, sourceLoc, null);
-    }
-
-    public static List<IAType> validatePartitioningExpressions(ARecordType 
recType, ARecordType metaRecType,
-            List<List<String>> partitioningExprs, List<Integer> 
keySourceIndicators, boolean autogenerated,
             SourceLocation sourceLoc, List<TypeExpression> 
partitioningExprTypes) throws AlgebricksException {
         return validatePartitioningExpressionsImpl(recType, metaRecType, 
partitioningExprs, keySourceIndicators,
                 autogenerated, true, sourceLoc, partitioningExprTypes);
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index c4ce19d..d52429f 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -954,9 +954,8 @@
                             ((InternalDetailsDecl) 
dd.getDatasetDetailsDecl()).getKeySourceIndicators();
                     boolean autogenerated = ((InternalDetailsDecl) 
dd.getDatasetDetailsDecl()).isAutogenerated();
                     ARecordType aRecordType = (ARecordType) itemType;
-                    List<IAType> partitioningTypes =
-                            
ValidateUtil.validatePartitioningExpressions(aRecordType, metaRecType, 
partitioningExprs,
-                                    keySourceIndicators, autogenerated, 
sourceLoc, partitioningExprTypes);
+                    List<IAType> partitioningTypes = 
validatePartitioningExpressions(aRecordType, metaRecType,
+                            partitioningExprs, keySourceIndicators, 
autogenerated, sourceLoc, partitioningExprTypes);

                     List<String> filterField = ((InternalDetailsDecl) 
dd.getDatasetDetailsDecl()).getFilterField();
                     Integer filterSourceIndicator =
@@ -1900,6 +1899,13 @@
         ValidateUtil.validateIndexFieldType(indexType, fieldType, 
displayFieldName, sourceLoc);
     }

+    protected List<IAType> validatePartitioningExpressions(ARecordType 
recType, ARecordType metaRecType,
+            List<List<String>> partitioningExprs, List<Integer> 
keySourceIndicators, boolean autogenerated,
+            SourceLocation sourceLoc, List<TypeExpression> 
partitioningExprTypes) throws AlgebricksException {
+        return ValidateUtil.validatePartitioningExpressions(recType, 
metaRecType, partitioningExprs,
+                keySourceIndicators, autogenerated, sourceLoc, 
partitioningExprTypes);
+    }
+
     protected void handleCreateTypeStatement(MetadataProvider 
metadataProvider, Statement stmt) throws Exception {
         TypeDecl stmtCreateType = (TypeDecl) stmt;
         SourceLocation sourceLoc = stmtCreateType.getSourceLocation();

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17954
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I07630be15f25cd140437e870cdeb4a7523363457
Gerrit-Change-Number: 17954
Gerrit-PatchSet: 4
Gerrit-Owner: Peeyush Gupta <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Peeyush Gupta <[email protected]>
Gerrit-MessageType: merged

Reply via email to