JingsongLi commented on code in PR #132:
URL: https://github.com/apache/flink-table-store/pull/132#discussion_r878787396
##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/mergetree/Levels.java:
##########
@@ -43,6 +43,16 @@ public class Levels {
public Levels(Comparator<RowData> keyComparator, List<DataFileMeta>
inputFiles, int numLevels) {
this.keyComparator = keyComparator;
+
+ // in case the num of levels is not specified explicitly
+ numLevels =
+ Math.max(
+ numLevels,
+ inputFiles.stream()
Review Comment:
NIT: We can extract a field here: `int restoreMaxLevel = ...`. The format of
the java stream in the method parameters doesn't look very good.
##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/mergetree/Levels.java:
##########
@@ -43,6 +43,16 @@ public class Levels {
public Levels(Comparator<RowData> keyComparator, List<DataFileMeta>
inputFiles, int numLevels) {
this.keyComparator = keyComparator;
+
+ // in case the num of levels is not specified explicitly
+ numLevels =
+ Math.max(
+ numLevels,
+ inputFiles.stream()
+ .map(DataFileMeta::level)
Review Comment:
NIT: `.mapToInt().max()`
--
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]