Yoni Augarten
02/07/2022, 11:49 AMproduction
. Does such branch exist?Chaim Turkel
02/07/2022, 11:50 AMChaim Turkel
02/07/2022, 11:50 AMYoni Augarten
02/07/2022, 11:58 AMlakectl dbt create-branch-schema
command, which will copy the schema to a new name, along with the tables managed by dbt. Everything in the created schema will point to your new branch. See the docs for more info.Chaim Turkel
02/07/2022, 11:58 AMChaim Turkel
02/07/2022, 12:05 PMYoni Augarten
02/07/2022, 12:11 PMChaim Turkel
02/07/2022, 1:38 PMChaim Turkel
02/07/2022, 1:45 PMChaim Turkel
02/07/2022, 1:45 PMroot@53f535723ab7:/dbt# $HOME/lakefs/lakectl dbt --log-level=TRACE create-branch-schema --branch production --to-schema test_branch
DEBU[0000]/home/runner/work/lakeFS/lakeFS/cmd/lakectl/cmd/root.go:67 <http://github.com/treeverse/lakefs/cmd/lakectl/cmd.glob..func69()|github.com/treeverse/lakefs/cmd/lakectl/cmd.glob..func69()> loaded configuration from file fields.file=/root/.lakectl.yaml file=/root/.lakectl.yaml
exit status 1
Error executing command.
Yoni Augarten
02/07/2022, 1:50 PMdbt debug
?This will help us narrow down the causeYoni Augarten
02/07/2022, 1:51 PMChaim Turkel
02/07/2022, 1:55 PMChaim Turkel
02/07/2022, 1:55 PMYoni Augarten
02/07/2022, 1:56 PMChaim Turkel
02/07/2022, 1:59 PMYoni Augarten
02/07/2022, 1:59 PMChaim Turkel
02/07/2022, 1:59 PMroot@30449b82af06:/dbt# $HOME/lakefs/lakectl dbt --log-level=DEBUG create-branch-schema --branch test_me
DEBU[0000]/home/runner/work/lakeFS/lakeFS/cmd/lakectl/cmd/root.go:67 <http://github.com/treeverse/lakefs/cmd/lakectl/cmd.glob..func69()|github.com/treeverse/lakefs/cmd/lakectl/cmd.glob..func69()> loaded configuration from file fields.file=/root/.lakectl.yaml file=/root/.lakectl.yaml
dbt debug succeeded with schema dbt_chaim
address <thrift://10.1.1.98:9083>: too many colons in address
Chaim Turkel
02/07/2022, 2:00 PMGuy Hardonag
02/07/2022, 2:03 PMthrift://
from the uri in the lakectl.yaml
fileGuy Hardonag
02/07/2022, 2:03 PMChaim Turkel
02/07/2022, 2:10 PMError executing command.
root@ec2c30d380b0:/dbt# $HOME/lakefs/lakectl dbt --log-level=DEBUG create-branch-schema --branch test_me
DEBU[0000]/home/runner/work/lakeFS/lakeFS/cmd/lakectl/cmd/root.go:67 <http://github.com/treeverse/lakefs/cmd/lakectl/cmd.glob..func69()|github.com/treeverse/lakefs/cmd/lakectl/cmd.glob..func69()> loaded configuration from file fields.file=/root/.lakectl.yaml file=/root/.lakectl.yaml
dbt debug succeeded with schema dbt_chaim
MetaException({Message:Got exception: java.io.FileNotFoundException innerMkdirs on <lakefs://data-application/test_me/dbt>: com.amazonaws.services.s3.model.AmazonS3Exception: The specified bucket does not exist (Service: Amazon S3; Status Code: 404; Error Code: NoSuchBucket; Request ID: 775ea914-ee37-4fff-a53d-0485a99112be; S3 Extended Request ID: BFB30E4CCEBF4A71), S3 Extended Request ID: BFB30E4CCEBF4A71})
Error executing command.
Guy Hardonag
02/07/2022, 2:14 PMChaim Turkel
02/07/2022, 2:14 PMGuy Hardonag
02/07/2022, 2:15 PMChaim Turkel
02/07/2022, 2:40 PMYoni Augarten
02/07/2022, 2:46 PMGuy Hardonag
02/07/2022, 2:47 PMlakectl dbt generate-schema-macro
command.
If you don’t want to create the macro, you could start with the --skip-view
flag. That would copy all the tables to the new database. You could later create the views using dbt by running dbt run --select config.materialized:view
Chaim Turkel
02/08/2022, 9:43 AMroot@7b944fccfdd4:/dbt# $HOME/lakefs/lakectl dbt create-branch-schema --branch production --to-schema new_branch
dbt debug succeeded with schema dbt_chaim
schema new_branch created
copied dbt_chaim.dim_loyalty_merchants -> new_branch.dim_loyalty_merchants
copied dbt_chaim.dim_opportunity -> new_branch.dim_opportunity
copied dbt_chaim.fact_loyalty_purchases -> new_branch.fact_loyalty_purchases
copied dbt_chaim.fact_points_redemptions -> new_branch.fact_points_redemptions
copied dbt_chaim.fact_referral_codes -> new_branch.fact_referral_codes
copied dbt_chaim.loyalty__stg_daily_points_redemptions -> new_branch.loyalty__stg_daily_points_redemptions
copied dbt_chaim.loyalty__stg_fact_loyalty_purchases -> new_branch.loyalty__stg_fact_loyalty_purchases
failed creating views with err: exit status 2
Error executing command.
Yoni Augarten
02/08/2022, 9:56 AMprofiles.yml
file to use your new schema, you can trigger the failed phase manually. To do so, run dbt run --select config.materialized:view
.
We are working on improving the error messages, so it will be easier to debug in the future.Chaim Turkel
02/08/2022, 3:46 PMYoni Augarten
02/08/2022, 3:56 PMYoni Augarten
02/08/2022, 3:59 PMlakectl --version
, to make sure you’re using the latest one?Guy Hardonag
02/08/2022, 4:07 PMlakectl dbt create-branch-schema
command is currently in master and wasn’t yet releasedGuy Hardonag
02/08/2022, 4:08 PMChaim Turkel
02/08/2022, 8:45 PM