Skip to content

Commit 1358dcd

Browse files
committed
update documentation for cloud storage and 0.27.4
1 parent ded9581 commit 1358dcd

2 files changed

Lines changed: 85 additions & 8 deletions

File tree

README.md

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FastBCP is a command line that export data from a database to CSV , JSON, Parquet or XLSX file(s) (or even binary file(s))
44

5-
![FastBCP](images/FastBCP.png)
5+
![FastBCP](images/FastBCP_V2.png)
66

77
## Table of Contents
88

@@ -232,15 +232,17 @@ This field is mandatory if some parallel method is used like Rowid and Ctid
232232

233233
### Directory (`-D` or `--directory`)
234234
Specify where the output file will be generated. it could be :
235-
- a local directory `/data/db/schema/tname/` or `d:\data\db\schema\tname\`v
235+
- a local directory `/data/db/schema/tname/` or `d:\data\db\schema\tname\`
236+
- a remote directory `\\uncpath\db\schema\tname\`
236237
- an aws s3 or s3 compatible s3 path : `s3://bucket/db/schema/tname/`
237-
- a gcs localtion : `gcs://bucket/db/schema/tname/`
238-
- *coming soon* : an azure abfss location : `abfss://<file_system>.dfs.core.windows.net/<path>/`
238+
- a gcs localtion : `gs://bucket/db/schema/tname/`
239+
- an azure blob storage location : `abs://<storage_account>.blob.core.windows.net/<container>/<path>/`
240+
- an azure datalake gen2 location : `abfss://<file_system>.dfs.core.windows.net/<path>/`
239241

240242
### Output file (`-o` or `--fileoutput`)
241243
The name of the final file generated by FastBCP.
242-
**IMPORTANT : the file extension will define the output format : csv, tsv, json, bson, parquet, xlsx or binary (postgresql source only for binary)**
243-
For parallel extraction without merge, the file name (without file extension) will be used as a prefix for the distributed files.
244+
<br> **IMPORTANT : the file extension will define the output format : csv, tsv, json, bson, parquet, xlsx or binary (postgresql source only for binary)**
245+
244246

245247
### Timestamped output (`-x` or `--timestamped` switch)
246248
Will add a timestamp to the output file name if the switch is used
@@ -274,7 +276,7 @@ How boolean are formatted (`true/false`, `t/f` or `1/0`)
274276
### cloud profile (--cloudprofile)
275277
specify the name of the cloud profile
276278
- for aws and s3 compatible aws cli : `aws configure --profile profilename`
277-
-
279+
- for gcs it should be the location of the json key file
278280

279281
**Nota1** : for **S3 compatible** target you must define the S3_ENDPOINT environment variable to define the proper S3 endpoint :
280282
- exemple bash : `export S3_ENDPOINT = "https://play.min.io:9000"`
@@ -285,7 +287,11 @@ specify the name of the cloud profile
285287
- `s3:AbortMultipartUpload`
286288
- `s3:ListMultipartUploadParts`
287289

288-
290+
**Nota 3**
291+
For S3, Azure and GCS, without a cloud profile, FastBCP will try to use the default chain authentication mecanism of the cloud provider.
292+
- For AWS/S3 : [AWS Default Credential Provider Chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default)
293+
- For Azure : [Azure Default Credential Provider Chain](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet)
294+
- For GCS : [GCS Default Credential Provider Chain](https://cloud.google.com/docs/authentication/production)
289295

290296
## Advanced Parameters
291297

@@ -486,5 +492,76 @@ You can have a lookp on the live [FastBCP Performance dashboard](https://public.
486492
```
487493

488494

495+
#### Parallel using RangeId from mssql to parquet on GCS bucket:
496+
``` powershell
497+
.\FastBCP.exe `
498+
--connectiontype mssql `
499+
--server localhost `
500+
--database "tpch10_collation_bin2" `
501+
--trusted `
502+
--query "SELECT * FROM dbo.orders" `
503+
--directory "gs://targetbucket/bronze/tpch" `
504+
--cloudprofile "fastbcp_profile" `
505+
--fileoutput "mssql_orders.parquet" `
506+
--method RangeId `
507+
--distributekeycolumn "o_orderkey" `
508+
--paralleldegree 12 `
509+
--merge false `
510+
--runid "mssql_to_parquet_aws_s3"
511+
```
512+
513+
#### Parallel using DataDriven from mssql to parquet on GCS bucket with datadriven query:
514+
``` powershell
515+
.\FastBCP.exe `
516+
--connectiontype "mssql" `
517+
--server "localhost" `
518+
--database "tpch10_collation_bin2" `
519+
--trusted `
520+
--query "select * from orders" `
521+
--directory "gs://aetpftoutput/test/" `
522+
--fileoutput "mssql_orders.parquet" `
523+
--method "DataDriven" `
524+
--distributekeycolumn "o_orderdate" `
525+
--datadrivenquery " select top 100 * from (select distinct o_orderdate from orders WHERE o_orderdate between '19950101' and '19950630') a order by 1desc" `
526+
--cloudprofile "C:\app\fastbcp\gcs\fastbcp_arpeio_key.json"
527+
--paralleldegree -2
528+
```
529+
530+
#### Parallel using DataDriven from mssql to parquet on Azure Datalake Gen2 or Azure Blob Storage with datadriven query:
531+
532+
```powershell
533+
# For Azure you can define the following environment variables for authentication
534+
$env:AZURE_CLIENT_ID="<ClientID>"
535+
$env:AZURE_TENANT_ID="<TenantId>"
536+
$env:AZURE_CLIENT_SECRET="<SecretID>"
537+
538+
# Azure Datalake Gen 2
539+
.\FastBCP.exe `
540+
--connectiontype "mssql" `
541+
--server "localhost" `
542+
--database "tpch10_collation_bin2" `
543+
--trusted `
544+
--query "select * from orders" `
545+
--directory "abfss://aetpadlseu.dfs.core.windows.net/fastbcpoutput/testdfs/orders/" `
546+
--fileoutput "mssql_orders.parquet" `
547+
--method "DataDriven" `
548+
--distributekeycolumn "o_orderdate" `
549+
--datadrivenquery " select top 100 * from (select distinct o_orderdate from orders WHERE o_orderdate between '19950101' and '19950630') a order by 1 desc"
550+
551+
552+
# Azure Blob Storage
553+
.\FastBCP.exe `
554+
--connectiontype "mssql" `
555+
--server "localhost" `
556+
--database "tpch10_collation_bin2" `
557+
--trusted `
558+
--query "select * from orders" `
559+
--directory "abs://aetpadlseu.blob.core.windows.net/fastbcpoutput/testblob/orders/" `
560+
--fileoutput "mssql_orders.parquet" `
561+
--method "DataDriven" `
562+
--distributekeycolumn "o_orderdate" `
563+
--datadrivenquery " select top 100 * from (select distinct o_orderdate from orders WHERE o_orderdate between '19950101' and '19950630') a order by 1 desc"
564+
```
565+
489566
You can find more exemples in the [samples.ps1](samples.ps1.md) file
490567

images/FastBCP_V2.png

152 KB
Loading

0 commit comments

Comments
 (0)