Fix TimestampBasedKeyGenerator when DATE_STRING is used for partitionpath.field
This commit is contained in:
@@ -91,7 +91,7 @@ public class TimestampBasedKeyGenerator extends SimpleKeyGenerator {
|
|||||||
} else if (partitionVal instanceof Long) {
|
} else if (partitionVal instanceof Long) {
|
||||||
unixTime = (Long) partitionVal;
|
unixTime = (Long) partitionVal;
|
||||||
} else if (partitionVal instanceof String) {
|
} else if (partitionVal instanceof String) {
|
||||||
unixTime = inputDateFormat.parse(partitionVal.toString()).getTime();
|
unixTime = inputDateFormat.parse(partitionVal.toString()).getTime() / 1000;
|
||||||
} else {
|
} else {
|
||||||
throw new HoodieNotSupportedException("Unexpected type for partition field: "+ partitionVal.getClass().getName());
|
throw new HoodieNotSupportedException("Unexpected type for partition field: "+ partitionVal.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user