Hello support team! Is it true that Rudderstack so...
# support
s
Hello support team! Is it true that Rudderstack sorts the columns in alphabetical order before saving the files on S3 (for example, using Amazon S3 Datalake destination)? What happens if a new column is added? Will it be appended to the end of the file or will it be inserted alphabetically somewhere in the middle of the column list?
s
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
q
Hi @silly-holiday-31165 It is alphabetically sorted and stored in s3. If new column comes, it will be fit in order too. S3 datalake stores data in s3 as parquet files. Parquet stores data in
key-value
pair so order does not actually matter here.
s
Hello @quiet-wolf-72320. Understood. Yet it matters when you want to load this data to Redshift. Redshift cannot handle schema evolution of parquet files if new columns are added not at the of its schema.
It actually makes impossible to make a backward-compatible schema change in a Redshift table if using S3 as a data source
Copy code
COPY inserts values into the target table's columns in the same order as the columns occur in the columnar data files. The number of columns in the target table and the number of columns in the data file must match.
https://docs.aws.amazon.com/redshift/latest/dg/copy-usage_notes-copy-from-columnar.html
@quiet-wolf-72320 Is there a way to avoid sorting column names in the target parquet files on S3?
q
@silly-holiday-31165 As I understand, you are trying 1. Source -> S3 (sorted and stored by rudderstack) 2. S3 -> Redshift ( Sorted column has a problem here) Is my understanding correct? Have you tried sending the data from the same source to both destinations? Something like Source -> S3 Source -> Redshift
s
As I understand, you are trying
1. Source -> S3 (sorted and stored by rudderstack)
2. S3 -> Redshift ( Sorted column has a problem here)
Yes, exactly. I did not try to use Amazon Redshift destination and send data directly to the database because we pause and resume our redshift cluster and it is not available for a certain number of hours during the day. We don’t want to lose data produced by Rudderstack when our cluster is off. S3 destination gives us liberty to backfill data whenever we feel appropriate.
q
@silly-holiday-31165 This S3 implementation is for a broader user base where usual workflows are being used and changing it will cause issue with other users. If you want to explore the custom changes, you can try an independent deployment that is available for enterprise customers.
s
Understood. Thank you.