1
0

[HUDI-1143] Change timestamp field in HoodieTestDataGenerator from double to long

This commit is contained in:
shenh062326
2020-09-06 16:00:45 +08:00
committed by n3nash
parent 6c84ef20ac
commit 581d54097c
18 changed files with 176 additions and 47 deletions

View File

@@ -64,7 +64,7 @@ public class ITTestBootstrapCommand extends AbstractShellIntegrationTest {
// generate test data
partitions = Arrays.asList("2018", "2019", "2020");
double timestamp = new Double(Instant.now().toEpochMilli()).longValue();
long timestamp = Instant.now().toEpochMilli();
for (int i = 0; i < partitions.size(); i++) {
Dataset<Row> df = TestBootstrap.generateTestRawTripDataset(timestamp,
i * NUM_OF_RECORDS, i * NUM_OF_RECORDS + NUM_OF_RECORDS, null, jsc, sqlContext);

View File

@@ -163,12 +163,12 @@ public class ITTestHDFSParquetImportCommand extends AbstractShellIntegrationTest
List<Row> readData = ds.select("timestamp", "_row_key", "rider", "driver", "begin_lat", "begin_lon", "end_lat", "end_lon").collectAsList();
List<HoodieTripModel> result = readData.stream().map(row ->
new HoodieTripModel(row.getDouble(0), row.getString(1), row.getString(2), row.getString(3), row.getDouble(4),
new HoodieTripModel(row.getLong(0), row.getString(1), row.getString(2), row.getString(3), row.getDouble(4),
row.getDouble(5), row.getDouble(6), row.getDouble(7)))
.collect(Collectors.toList());
List<HoodieTripModel> expected = expectData.stream().map(g ->
new HoodieTripModel(Double.parseDouble(g.get("timestamp").toString()),
new HoodieTripModel(Long.parseLong(g.get("timestamp").toString()),
g.get("_row_key").toString(),
g.get("rider").toString(),
g.get("driver").toString(),