panbingkun commented on code in PR #45776:
URL: https://github.com/apache/spark/pull/45776#discussion_r1545540101


##########
sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameWriterV2Suite.java:
##########
@@ -26,29 +32,30 @@
 import org.apache.spark.sql.connector.catalog.InMemoryTableCatalog;
 import org.apache.spark.sql.test.TestSparkSession;
 import org.apache.spark.sql.types.StructType;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
+import org.apache.spark.util.Utils;
 
 import static org.apache.spark.sql.functions.*;
 
 public class JavaDataFrameWriterV2Suite {
   private static StructType schema = new StructType().add("s", "string");
   private SparkSession spark = null;
+  private transient String input;
 
   public Dataset<Row> df() {
-    return spark.read().schema(schema).text();
+    return spark.read().schema(schema).text(input);
   }
 
   @BeforeEach
   public void createTestTable() {
     this.spark = new TestSparkSession();
     spark.conf().set("spark.sql.catalog.testcat", 
InMemoryTableCatalog.class.getName());
     spark.sql("CREATE TABLE testcat.t (s string) USING foo");
+    input = Utils.createTempDir(System.getProperty("java.io.tmpdir"), 
"input").toString();

Review Comment:
   Very reasonable, but `unfortunately`, this is `Java` code and it does `not 
support` this writing style.
   As follows:
   <img width="709" alt="image" 
src="https://github.com/apache/spark/assets/15246973/ffe05290-8d96-4177-9c18-cddfa38d6470";>



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

Reply via email to