maropu commented on a change in pull request #31449:
URL: https://github.com/apache/spark/pull/31449#discussion_r569216298



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala
##########
@@ -122,24 +123,45 @@ class DataSourceScanExecRedactionSuite extends 
DataSourceScanRedactionTest {
   test("SPARK-31793: FileSourceScanExec metadata should contain limited file 
paths") {
     withTempPath { path =>
       val dir = path.getCanonicalPath
+
+      // create a sub-directory with long name so that each root path will 
always exceed the limit
+      // this is to ensure we always test the case for the path truncation
+      // 110 = limit 100 + margin 10 to clearly avoid edge case
+      val dataDir = if (dir.length >= 110) {

Review comment:
       Ah I see. If so, the current one looks fine. Could you leave some 
comments there about the limit? I didn't know it and it seems the max name 
length is 255 and the max path length is 4096? (I googled it)




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to