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



##########
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:
       I'm not 100% sure about the possible glitch on long long path (like 
exceeding 255 chars), but I agree that should be simpler if there's no problem 
on the length of path. Do you have any idea on this?




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