cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

can you help me with connection between databricks and sftp file using paramiko??

115412
New Contributor

https://community.databricks.com/s/question/0D58Y00009fClizSAC/ssh-connection-with-paramiko i read in this post that you can help me with that problem, please can you give me more advice what i have to do to connect to an sftp through ssh

1 ACCEPTED SOLUTION

Accepted Solutions

here is a sample code you can try:

transport = paramiko.Transport((host, port))
transport.connect(None, username, password)
sftp_path =sftp_path + sftp_file_name
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(sftp_path, replaced_local_path + flat_file_name)

please ensure the all the variables are correctly defined and the connection to the host server is open.

View solution in original post

2 REPLIES 2

ZhengHuang
New Contributor III

Hi!

Could you please let me know what your current blocker is? Are you looking for a code snippet that can help you get file through sftp? Or if you are looking for the spark config that whitelist the port? Or if you are blocked by some other error?

here is a sample code you can try:

transport = paramiko.Transport((host, port))
transport.connect(None, username, password)
sftp_path =sftp_path + sftp_file_name
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(sftp_path, replaced_local_path + flat_file_name)

please ensure the all the variables are correctly defined and the connection to the host server is open.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group