[
https://issues.apache.org/jira/browse/BEAM-10292?focusedWorklogId=472535&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-472535
]
ASF GitHub Bot logged work on BEAM-10292:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Aug/20 17:07
Start Date: 19/Aug/20 17:07
Worklog Time Spent: 10m
Work Description: lukecwik commented on a change in pull request #12050:
URL: https://github.com/apache/beam/pull/12050#discussion_r473191445
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/io/LocalFileSystem.java
##########
@@ -202,6 +202,10 @@ protected void delete(Collection<LocalResourceId>
resourceIds) throws IOExceptio
@Override
protected LocalResourceId matchNewResource(String singleResourceSpec,
boolean isDirectory) {
+ if (singleResourceSpec.endsWith(File.separator) && !isDirectory) {
Review comment:
Do you want to add the file separator if it doesn't exist if
`isDirectory == true`. This will help make it less error prone for users.
Similar to
[GcsFileSystem](https://github.com/apache/beam/blob/f3ac4822191ca63d74a8fd71f81da976b3d2fbd1/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/storage/GcsFileSystem.java#L154).
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 472535)
Time Spent: 2h 40m (was: 2.5h)
> DefaultFilenamePolicy.ParamsCoder loses information whether Params's resource
> ID is file/directory
> --------------------------------------------------------------------------------------------------
>
> Key: BEAM-10292
> URL: https://issues.apache.org/jira/browse/BEAM-10292
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: David Janicek
> Priority: P2
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> *DefaultFilenamePolicy.ParamsCoder* uses simple *StringUtf8Coder* for
> encoding/decoding *DefaultFilenamePolicy.Params*'s *baseFilename* and
> therefore looses information whether *Params.baseFilename* resource ID is
> file or directory.
> The result is that it's effectively preventing user to define directory as
> *baseFilename provider* when using dynamic destinations because after
> deserialization it's translated to file.
> Solution is easy - use *ResourceIdCoder* for encoding/decoding.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)