haospotai commented on issue #828: Synchronizing to hive partition is incorrect
URL: https://github.com/apache/incubator-hudi/issues/828#issuecomment-568149860
 
 
   ```java
     /**
      * Generate Hive Partition from partition values
      * 
      * @param partition Partition path
      * @return
      */
     private String getPartitionClause(String partition) {
       List<String> partitionValues = 
partitionValueExtractor.extractPartitionValuesInPath(partition);
       Preconditions.checkArgument(syncConfig.partitionFields.size() == 
partitionValues.size(),
           "Partition key parts " + syncConfig.partitionFields + " does not 
match with partition values " + partitionValues
               + ". Check partition strategy. ");
       List<String> partBuilder = new ArrayList<>();
       for (int i = 0; i < syncConfig.partitionFields.size(); i++) {
         partBuilder.add(syncConfig.partitionFields.get(i) + "=" + "'" + 
partitionValues.get(i) + "'");
       }
       return partBuilder.stream().collect(Collectors.joining(","));
     }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to