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/08/12 02:37:41 UTC
[GitHub] [incubator-hudi] imperio-wxm commented on issue #828: Synchronizing
to hive partition is incorrect
imperio-wxm commented on issue #828: Synchronizing to hive partition is incorrect
URL: https://github.com/apache/incubator-hudi/issues/828#issuecomment-520285294
@vinothchandar @n3nash
> The hive partition should be in the form of key=value and hudi missing part_date field name.
> **This is should be something I understand some problems**
Default partition value is yyyy/mm/dd and I rewrote the partitioning method change to yyyy-mm-dd
```java
@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));
}
```
**Have an important question:
When I run the job for the first time, no partition is added to generate the file. When I run the second time, the partition will be added automatically, but the first data will not be loaded. I want to konw why?**
----------------------------------------------------------------
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