lirui-apache commented on a change in pull request #16148:
URL: https://github.com/apache/flink/pull/16148#discussion_r657583225



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/read/HiveSourceSplit.java
##########
@@ -67,12 +69,22 @@ public HiveSourceSplit(
         super(id, filePath, offset, length, hostnames, readerPosition);
         this.hiveTablePartition =
                 checkNotNull(hiveTablePartition, "hiveTablePartition can not 
be null");
+        final String hosts =
+                hostnames.length == 0 ? "(no host info)" : " hosts=" + 
Arrays.toString(hostnames);
+        this.detailInfoForSplit =
+                String.format(
+                        "HiveSourceSplit: %s [%d, %d) %s ID=%s position=%s",
+                        filePath, offset, offset + length, hosts, id, 
readerPosition);
     }
 
     public HiveTablePartition getHiveTablePartition() {
         return hiveTablePartition;
     }
 
+    public String getDetailInfoForSplit() {
+        return detailInfoForSplit;

Review comment:
       We can just use `toString` to print the split. That'll make things more 
consistent. And I think information such as `hosts` and `offset` are not very 
useful because they're irrelevant to how the split is consumed.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to