1

I can see a answer for my question in the following post How to read from one DB but write to another using Snowflake's Snowpark?

Since i do not have access to add comment raising as separate question here.

I really new to snowflake and snowpark. I have to copy data from Prod DB to Test DB. both are having different users and different roles. I may need to create 2 sessions to connect the databases. How to pass the data from Prod snowpark session to test snow park session session.

Source session parameters

connection_parameters = {
"account": "abc.snowflake.come",
"user": "Produser1",
"password": "123",
"role": "PROD_USER",  
"warehouse": "WF_IT", 
"database": "ProdUser", 
"schema": "user" 
}

Target session parameters

connection_parameters =     {
"account":     "abc.snowflake.come",
"user": "TestUser1",
"role": "Test_USER",  
"warehouse": "WF_IT", 
"database": "DevUser", 
"schema": "user" 
}  
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Sakthi S
  • 11
  • 1
  • Create a user that has the appropriate permissions on both databases? – NickW Jun 17 '23 at 12:15
  • Thanks for your response, As per the company policy we are not allowed to create user access with both data base. We have different users and different role for both Databases. is there any chance to pass the data between the sessions( i guess may need to create separate sessions). – Sakthi S Jun 18 '23 at 05:17
  • 1
    In that case it sounds like what you are trying to do is breaking your company policy. If your company allows data to be moved between these two databases then it should also allow the creation of a user/role that enables this – NickW Jun 18 '23 at 08:08
  • Thanks Nick, I actually i have not breaking my company policy. currently our team using other tools like Delphix to download from prod to test. the tool takes long time to move the data. I tried better way using snowpark let me double check with my company data policy – Sakthi S Jun 19 '23 at 03:10
  • It is possible to user two different users and create two different sessions, but it complicates the overall flow. The easiest option is a single user with access to both databases as @NickW suggested in the first place. – Sergiu Jun 19 '23 at 11:45
  • Hi Sergiu Thanks for your comment, I understand the single user is is the easiest way. My company have strong policy not allowing me. could you please explain how to pass the data between two session. I will try it even complicates – Sakthi S Jun 19 '23 at 22:03
  • I missed to mention with NickW and sergiu that, we are using different account for PROD and DEV so i must use two sessions only. kindly help me – Sakthi S Jun 20 '23 at 03:29
  • Just share/replicate the data then – NickW Jun 20 '23 at 06:09

0 Answers0