stevenzwu commented on code in PR #9452:
URL: https://github.com/apache/iceberg/pull/9452#discussion_r1462361510


##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/util/FlinkPackage.java:
##########
@@ -18,16 +18,44 @@
  */
 package org.apache.iceberg.flink.util;
 
+import java.util.concurrent.atomic.AtomicReference;
 import org.apache.flink.streaming.api.datastream.DataStream;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
 
 public class FlinkPackage {
-  /** Choose {@link DataStream} class because it is one of the core Flink API. 
*/
-  private static final String VERSION = 
DataStream.class.getPackage().getImplementationVersion();
+
+  private static final AtomicReference<String> VERSION = new 
AtomicReference<>();
+  public static final String FLINK_UNKNOWN_VERSION = "FLINK-UNKNOWN-VERSION";
 
   private FlinkPackage() {}
 
   /** Returns Flink version string like x.y.z */
   public static String version() {
-    return VERSION;
+    if (null == VERSION.get()) {

Review Comment:
   I am not sure it is really necessary to add a unit test for the trivial 
change. anyway, this is fine to me. I will leave the style decision to @nastra 
and @pvary 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to