File tree Expand file tree Collapse file tree
sdks/java/core/src/main/java/org/apache/beam/sdk/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -353,7 +353,16 @@ private String windowToString(BoundedWindow window) {
353353 }
354354 if (window instanceof IntervalWindow ) {
355355 IntervalWindow iw = (IntervalWindow ) window ;
356- return String .format ("%s-%s" , iw .start ().toString (), iw .end ().toString ());
356+ // Use ISO-8601 format but replace colons with underscores for Windows compatibility
357+ // since colons are illegal characters in Windows file paths.
358+ String startStr = iw .start ().toString ();
359+ String endStr = iw .end ().toString ();
360+ String osName = System .getProperty ("os.name" );
361+ if (osName != null && osName .startsWith ("Windows" )) {
362+ startStr = startStr .replace (':' , '_' );
363+ endStr = endStr .replace (':' , '_' );
364+ }
365+ return String .format ("%s-%s" , startStr , endStr );
357366 }
358367 return window .toString ();
359368 }
You can’t perform that action at this time.
0 commit comments