NOTE: Shell commands are run from C:\Users\Administrators\Downloads
as this is where mc.exe
is present.
- Setup steps
# Copy data into bucket for sqlserver
mc.exe cp -r dcmin/datasets/people-10m/ dcmin/sqltest/people-10m/
-
Show demo script
parquet-1-external-demo.sql
-
Cleanup steps
# Remove the data from dcmin/sqltest/ for cleanup
mc.exe rm -r --force dcmin/sqltest/people-10m
The purpose is to recover disk space on SQLServer when tables get large.
-
Show demo script
move-heroes-demo.sql
-
Show that file now exists in MinIO
mc.exe ls dcmin/sqltest/heroes.csv
mc.exe cat dcmin/sqltest/heroes.csv/<filename>
- Cleanup
mc.exe rm -r --force dcmin/sqltest/heroes.csv
-
Backup-Restore Demo: Use the scripts in the
backup-restore
directory in order. Ref: https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/sql-server-backup-to-url-s3-compatible-object-storage?view=sql-server-ver16 -
Access external data with OpenRowSet:
- Read a parquet file -
openrowset-0-external-demo.sql
- Read a CSV file -
openrowset-1-external-demo.sql
- Read a parquet file -
-
Access external data with an External Table
- Read a parquet file -
parquet-0-external-demo.sql
- Read a parquet file -
-
Create External Table from SQLServer (write tables to MinIO)
NOTE: Delete the outputs directory with
mc.exe rm -r --force dcmin/sqldemo2/cetas-outputs
before the demo.- Copy an internal table into MinIO -
cetas-0-external-demo.sql
- Process an external table and write results into MinIO -
cetas-1-external-demo.sql
- Copy an internal table into MinIO -
-
Join internal and external table -
join-internal-external.sql
-
Join external and external table -
join-external-external.sql
Ref to install the required packages: https://docs.microsoft.com/en-us/sql/relational-databases/polybase/polybase-linux-setup?view=sql-server-ver16
Ref to enable the feature: https://docs.microsoft.com/en-us/sql/relational-databases/polybase/polybase-configure-s3-compatible?view=sql-server-ver16#pre-configuration
Run common actions (create credentials, etc) from common.sql
Then switch to external-table-query
dir.
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'allow polybase export', 1;
GO
RECONFIGURE;
GO