xushiyan commented on code in PR #8490:
URL: https://github.com/apache/hudi/pull/8490#discussion_r1183239844
##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/RawTripTestPayload.java:
##########
@@ -76,8 +85,29 @@ public RawTripTestPayload(String jsonData) throws
IOException {
this.dataSize = jsonData.length();
Map<String, Object> jsonRecordMap = OBJECT_MAPPER.readValue(jsonData,
Map.class);
this.rowKey = jsonRecordMap.get("_row_key").toString();
- this.partitionPath =
jsonRecordMap.get("time").toString().split("T")[0].replace("-", "/");
+ this.partitionPath =
extractPartitionFromTimeField(jsonRecordMap.get("time").toString());
this.isDeleted = false;
+ this.orderingVal = Integer.valueOf(jsonRecordMap.getOrDefault("number",
0L).toString());
+ }
+
+ public RawTripTestPayload(GenericRecord record, Comparable orderingVal) {
Review Comment:
https://issues.apache.org/jira/browse/HUDI-6164
##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/RawTripTestPayload.java:
##########
@@ -86,7 +87,7 @@ public RawTripTestPayload(String jsonData) throws IOException
{
this.rowKey = jsonRecordMap.get("_row_key").toString();
this.partitionPath =
extractPartitionFromTimeField(jsonRecordMap.get("time").toString());
this.isDeleted = false;
- this.orderingVal = Integer.valueOf(jsonRecordMap.get("number").toString());
+ this.orderingVal = Integer.valueOf(jsonRecordMap.getOrDefault("number",
0L).toString());
Review Comment:
https://issues.apache.org/jira/browse/HUDI-6164
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]