SteNicholas commented on code in PR #394:
URL: https://github.com/apache/flink-table-store/pull/394#discussion_r1035465488


##########
flink-table-store-spark/src/main/java/org/apache/flink/table/store/spark/SparkTable.java:
##########
@@ -76,4 +94,47 @@ public Transform[] partitioning() {
         }
         return new Transform[0];
     }
+
+    @Override
+    public WriteBuilder newWriteBuilder(LogicalWriteInfo info) {
+        try {
+            // V1Write is introduced in Spark 3.2
+            // Use reflection to support Spark 3.0 and 3.1
+            return (WriteBuilder)
+                    
Class.forName("org.apache.flink.table.store.spark.SparkWriteBuilder")
+                            .getConstructors()[0]
+                            .newInstance(table, info.queryId(), lockFactory);
+        } catch (ClassNotFoundException
+                | IllegalAccessException
+                | InvocationTargetException
+                | InstantiationException e) {
+            throw new UnsupportedOperationException(
+                    "Please use Spark version 3.2 or above to support write.", 
e);

Review Comment:
   ```suggestion
                       "Please use Spark version 3.0 or above to support 
write.", e);
   ```



-- 
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...@flink.apache.org

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

Reply via email to