https://slingdata.io logo
Hi @flarco
# sling-help
l
Hi @flarco I am trying to load a bunch of parquet files from a bunch of s3 buckets into one single redshift table and it is not working for me Here are my
env.yaml
and
replication.yaml
files and this is the debug trace from the replication run
Copy code
sling run -r ortto_activities_s3_to_redshift_load.yaml --debug
2026-01-14 14:54:44 INF Sling CLI | https://slingdata.io
2026-01-14 14:54:44 DBG CLI Pro token validated
2026-01-14 14:54:44 DBG opened "s3" connection (conn-s3-LDM)
2026-01-14 14:54:44 INF Sling Replication | S3_DATA_SERVICES -> REDSHIFT_DEV | s3://datalake-external-eunorth01-ortto-norway/invalid-sms--is/
2026-01-14 14:54:44 DBG Sling version: 1.5.4 (windows amd64)
2026-01-14 14:54:44 DBG type is file-db
2026-01-14 14:54:44 DBG using: {"columns":null,"mode":"full-refresh","select":null,"transforms":null}
2026-01-14 14:54:44 DBG using source options: {"empty_as_null":false,"header":true,"fields_per_rec":-1,"compression":"auto","null_if":"NULL","datetime_format":"AUTO","skip_blank_lines":false,"max_decimals":-1}
2026-01-14 14:54:44 DBG using target options: {"datetime_format":"auto","file_max_rows":0,"max_decimals":-1,"use_bulk":true,"add_new_columns":true,"adjust_column_type":false,"column_casing":"normalize","table_tmp":"\"public\".\"sms_invalid_tmp\""}
2026-01-14 14:54:44 INF connecting to target database (redshift)
2026-01-14 14:54:44 DBG opened "redshift" connection (conn-redshift-redshift_dev-2YB)
2026-01-14 14:54:44 INF reading from source file system (s3)
2026-01-14 14:54:44 DBG opened "s3" connection (conn-s3-XsD)
2026-01-14 14:54:45 INF no files found
2026-01-14 14:54:45 DBG closed "redshift" connection (conn-redshift-redshift_dev-2YB)
2026-01-14 14:54:45 INF execution succeeded
Do i need to create different s3 bucket sources for different s3 buckets?? Am i using the correct mode when loading in to same table using different streams? https://cdn.discordapp.com/attachments/1210406123744796705/1460997123331063922/ortto_activities_s3_to_redshift_load.yaml?ex=69796dda&is=69781c5a&hm=81e5bd1c9208c1e1cde3b4c9f02ff955c61e00bf56679205e9e109aa007569a1& https://cdn.discordapp.com/attachments/1210406123744796705/1460997123918139563/sample_env.yaml?ex=69796dda&is=69781c5a&hm=f2c556ddf05a9ee9be17c286ed785a382989c1bae5b6914388cea251b3e5171e&
f
hey @lsscodes , yes one connection per S3 bucket. and no need to put the full URI, just the path:
Copy code
source: S3_DATA_SERVICES
target: REDSHIFT_DEV

env:
  SLING_THREADS: 3
  SLING_LOADED_AT_COLUMN: false

streams:
  invalid-sms--is/:
    object: 'public.sms_invalid'
    mode: full-refresh
    
    src_options:
      format: parquet
      empty_as_null: true
also, make sure to check your YAML indentation, the example you shared, the
s3://datalake-external-eunorth01-ortto-sweden/invalid-sms--is/
stream looks to be nested under
s3://datalake-external-eunorth01-ortto-norway/invalid-sms--is/
, so that would be ignored
l
i have multiple buckets loading data into the same table, what should be the mode? or how would the replication.yaml look like in that case
i changed this after posting the message
f
since they come from diff buckets, you can just one replication per bucket. but if it's the same path in different buckets, I would use an env var to define your S3 connection instead of env.yaml:
Copy code
export S3_DATA_SERVICES='{type: s3, bucket: slingdata-ingestion, access_key_id: ACCESS_KEY_ID, secret_access_key: "SECRET_ACCESS_KEY"}'

sling run -r replication.yaml
and just change the env var with diff bucket name. use
invalid-sms--is/
as the stream name, with the same object table name
but I see you want to do full refresh, so you could just put incremental. Have the first run be
full-refresh
, and the next ones
incremental
. is there a primary key?
l
i have different buckets but the prefix is still the "invalid-sms--is/" and i want data from different buckets into same table on the intial load and i dont have a primary key
f
one sec, let me test something
l
@flarco any update for me 😉
f
hey @lsscodes, apologies for the delay. yes, I was able to look at this, and you are correct that it doesn't work. This should be fixed for next release. in the meantime, you can do as I previously mentioned (re-using the same replication.yaml env providing a different source conn). Another path is to create a connection per bucket:
S3_DATA_SERVICES_NORWAY
,
S3_DATA_SERVICES_SWEDEN
, etc. and then set the source and env in your replication to:
Copy code
source: 'S3_DATA_SERVICES_{REGION}'
target: REDSHIFT_DEV

env:
  REGION: ${REGION}

streams:
  invalid-sms--is/:
    object: 'public.sms_invalid_{REGION}'
next, having a pipeline.yaml:
Copy code
steps:
  - type: group
    loop: [norway, sweden]
    steps:
      - replication: path/to/replication.yaml
        env:
          REGION: '{loop.value}'

  - type: query
    connection: redshift_dev
    query: truncate table exists public.sms_invalid

  - type: group
    loop: [norway, sweden]
    steps:
      - type: query
        connection: redshift_dev
        query: |
          insert into public.sms_invalid
          select * from public.sms_invalid_{loop.value};
          drop table if exists public.sms_invalid_{loop.value};
Then run this pipeline like this:
Copy code
sling run -p pipeline.yaml
This should do what you want as a workaround. In next release, it will be much better with just one replication file, allowing multi-buckets for one connection:
Copy code
source: S3_DATA_SERVICES
target: REDSHIFT_DEV

streams:
  sms_invalid:
    mode: full-refresh
    files:
      - s3://datalake-external-eunorth01-ortto-norway/invalid-sms--is/
      - s3://datalake-external-eunorth01-ortto-sweden/invalid-sms--is/
    object: 'public.sms_invalid'
l
@flarco thanks for the temp fix. i will give it a try right away and would wait for next release
I tried running the pipeline and ended up with error. could you help me with fixing errors
Copy code
sling run -p pipeline.yaml --debug >trace.log
2026-01-18 22:23:07 INF Sling CLI | https://slingdata.io
2026-01-18 22:23:07 DBG Sling version: 1.5.4 (windows amd64)
2026-01-18 22:23:07 DBG executing step "step-01-group" (type: group)
2026-01-18 22:23:07 DBG CLI Pro token validated
2026-01-18 22:23:07 DBG executing loop step "step-01-group-step-00" (type: replication)
2026-01-18 22:23:07 DBG failure while executing step "step-01-group-step-00" (type: replication) => yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `replica...` into map[string]interface {}
2026-01-18 22:23:07 DBG failure while executing step "step-01-group" (type: group) => yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `replica...` into map[string]interface {}
fatal:
--- proc.go:285 main ---
--- sling_cli.go:527 main ---
--- sling_cli.go:563 cliInit ---
--- cli.go:287 CliProcess ---
--- sling_run.go:269 processRun ---
--- sling_run.go:688 runPipeline ---
--- pipeline.go:222 Execute ---
~ failure running pipeline (see docs @ https://docs.slingdata.io)
--- pipeline.go:339 Execute ---
~ error executing step: step-01-group
--- hooks..go:2806 Execute ---
--- hooks..go:2749 func3 ---
~ error executing step: step-01-group-step-00
--- hooks..go:2180 Execute ---
~ error running replication
--- sling_run..go:42 RunReplication ---
~ Error parsing replication config
--- replication.go:1660 LoadReplicationConfigFromFile ---
~ Error parsing replication config
--- replication.go:1672 LoadReplicationConfig ---
~ Error parsing yaml content
--- replication.go:1466 UnmarshalReplication ---
yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `replica...` into map[string]interface {}
https://cdn.discordapp.com/attachments/1460997117534273705/1462559639374659805/replication.yaml?ex=696ea24f&is=696d50cf&hm=61936ab79410004222a356e979177662ffe9ccfd6d590c859bb1e5c54ed28fba& https://cdn.discordapp.com/attachments/1460997117534273705/1462559639622385856/pipeline.yaml?ex=696ea24f&is=696d50cf&hm=f5c447b6ef600525cb19f0abbb0b1e04599471f48eb01f40445ea3f1078a297a& https://cdn.discordapp.com/attachments/1460997117534273705/1462559639957934255/image.png?ex=696ea24f&is=696d50cf&hm=8a26c039775037c78afc695ce1511341dc4b5633d5817a6ceba082a370499627&
f
ah put
replication: file://path/to/replication.yaml
, i forgot the
file://
prefix
this is throwing s3 list limit warning when the stream path is
Copy code
archive/clicked-email--c
Copy code
sling run -p pipeline.yaml
11:29AM INF Sling CLI | https://slingdata.io
11:29AM INF Sling Replication | S3_DATA_SERVICES_ORTTO_finland -> REDSHIFT_DEV |
archive/clicked-email--c
11:29AM INF connecting to target database (redshift)
11:29AM INF reading from source file system (s3)
11:29AM WRN Limiting S3 list results at 10000 items. Set SLING_RECURSIVE_LIMIT to
i don't have this warning when stream path is just
Copy code
clicked-email--c
is this a bug or am i at wrong here?
When copying files from S3 to REDSHIFT table, i noticed following steps Step 1 - Files copied from S3 to local temp folder Step 2 - From local temp to S3 temp bucket Step 3 - From S3 temp bucket to REDSHIFT temp table Step 4 - From REDSHIFT temp table to REDSHIFT final table why not directly from S3 -> REDSHIFT temp table -> REDSHIFT final table ??
f
yes, this is the way it works to profile the data. There are definitely optimization possible with this. The way it works now allows more flexibilty for example GCP or Azure buckets -> local temp folder -> S3 -> Redshift.
l
and what about this
2 Views