You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2019/12/22 23:54:37 UTC

[GitHub] [incubator-hudi] haospotai edited a comment on issue #828: Synchronizing to hive partition is incorrect

haospotai edited a comment on issue #828: Synchronizing to hive partition is incorrect
URL: https://github.com/apache/incubator-hudi/issues/828#issuecomment-568312573
 
 
   Yes i did not use it,
   Maybe the partition path should be like */*/*/, which will be more flexible
   such as base on Date  or location form if I understand correctly
   
   
   On Sat, 21 Dec 2019 at 21:40, lamber-ken <no...@github.com> wrote:
   
   > it's correct on hudi-0.5.0
   >
   > private transient DateTimeFormatter dtfOut;
   >
   >   public SlashEncodedDayPartitionValueExtractor() {
   >     this.dtfOut = DateTimeFormat.forPattern("yyyy-MM-dd");
   >   }
   >
   >   private DateTimeFormatter getDtfOut() {
   >     if (dtfOut == null) {
   >       dtfOut = DateTimeFormat.forPattern("yyyy-MM-dd");
   >     }
   >     return dtfOut;
   >   }
   >
   >   @Override
   >   public List<String> extractPartitionValuesInPath(String partitionPath) {
   >     // partition path is expected to be in this format yyyy/mm/dd
   >     String[] splits = partitionPath.split("/");
   >     if (splits.length != 3) {
   >       throw new IllegalArgumentException("Partition path " + partitionPath + " is not in the form yyyy/mm/dd ");
   >     }
   >     // Get the partition part and remove the / as well at the end
   >     int year = Integer.parseInt(splits[0]);
   >     int mm = Integer.parseInt(splits[1]);
   >     int dd = Integer.parseInt(splits[2]);
   >     DateTime dateTime = new DateTime(year, mm, dd, 0, 0);
   >     return Lists.newArrayList(getDtfOut().print(dateTime));
   >   }
   >
   > hi, I guess you didn't use this parameter
   > DataSourceWriteOptions.HIVE_ASSUME_DATE_PARTITION_OPT_KEY.
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-hudi/issues/828?email_source=notifications&email_token=AN2KTR76YYUSOS7LMCKRSJLQZYMDFA5CNFSM4IKQF66KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHO4I3I#issuecomment-568181869>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AN2KTR7PJZ3X5DPUZ6BRILLQZYMDFANCNFSM4IKQF66A>
   > .
   >
   -- 
   Thanks
   Hao Li
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services