This is an automated email from the ASF dual-hosted git repository.

peeyush pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 22afe224f4 [NO ISSUE][OTH] Refactor function to validate partitioning 
expr
22afe224f4 is described below

commit 22afe224f4d1b237b3d83b0e1d54493859cc9d33
Author: Peeyush Gupta <[email protected]>
AuthorDate: Wed Nov 15 08:26:55 2023 -0800

    [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]>
---
 .../org/apache/asterix/translator/util/ValidateUtil.java     |  8 +-------
 .../org/apache/asterix/app/translator/QueryTranslator.java   | 12 +++++++++---
 2 files changed, 10 insertions(+), 10 deletions(-)

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 77c1a9d1d8..e253e07e8b 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 @@ public class ValidateUtil {
      * @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.
@@ -114,13 +115,6 @@ public class ValidateUtil {
      *                             if partitioning key is nullable.
      *                             if the field type can't be a primary key.
      */
-    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 {
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 c4ce19d442..d52429f1d6 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 @@ public class QueryTranslator extends AbstractLangTranslator 
implements IStatemen
                             ((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 @@ public class QueryTranslator extends 
AbstractLangTranslator implements IStatemen
         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();

Reply via email to