Good morning! Is there a way to get the output pre...
# ask-community-for-troubleshooting
j
Good morning! Is there a way to get the output prefix to be applied to the filename rather than a containing folder?
1
For example: I am currently grabbing from two different DBs and dropping into an S3 bucket. I would like it to look like FOLDER1/prefix_filename FOLDER1/prefix2_filename FOLDER2/prefix_Filename FOLDER2/prefix2_filename What I am getting is: NAMESPACE/prefix_NAME/filename-which-is-a-date-and-an-apparently-random-string-of-characters I want to eliminate one level of folder completely. How do I go about this?
a
Hi @Justin Cole, I'm afraid this is not possible at the moment to add a custom prefix to the S3 key. I found the code that generates the output file name, and it does not take a custom prefix argument:
Copy code
public static String getOutputFilename(final Timestamp timestamp, final String customSuffix, final S3Format format) {
    final DateFormat formatter = new SimpleDateFormat(S3DestinationConstants.YYYY_MM_DD_FORMAT_STRING);
    formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    return String.format(
        "%s_%d%s.%s",
        formatter.format(timestamp),
        timestamp.getTime(),
        customSuffix,
        format.getFileExtension());
  }
Feel free to open an issue to request this feature.
j
OK. Cool. I can accept that. Is there a way to eliminate one level of the folders?
So that I get prefixFOLDERNAME/filename ?