nastra commented on code in PR #9728:
URL: https://github.com/apache/iceberg/pull/9728#discussion_r1576019460
##########
core/src/main/java/org/apache/iceberg/FileScanTaskParser.java:
##########
@@ -40,16 +40,39 @@ public class FileScanTaskParser {
private FileScanTaskParser() {}
+ /**
+ * Serialize file scan task to JSON string
+ *
+ * @deprecated Use {@link ScanTaskParser#toJson(FileScanTask)} instead; will
be removed in 1.7.0
+ */
+ @Deprecated
public static String toJson(FileScanTask fileScanTask) {
- return JsonUtil.generate(
- generator -> FileScanTaskParser.toJson(fileScanTask, generator),
false);
+ Preconditions.checkArgument(fileScanTask != null, "Invalid file scan task:
null");
+ return JsonUtil.generate(generator -> toJsonWrapper(fileScanTask,
generator), false);
Review Comment:
I don't think we need this extra method as we can just inline this:
```
@Deprecated
public static String toJson(FileScanTask fileScanTask) {
Preconditions.checkArgument(fileScanTask != null, "Invalid file scan
task: null");
return JsonUtil.generate(
generator -> {
generator.writeStartObject();
toJson(fileScanTask, generator);
generator.writeEndObject();
},
false);
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]