Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
I'm trying to get the certain value of my variable in the for loop but it's returning the syntax instead of the value. Also, is it possible to covert this value to an integer? Thanks
So, in my opinion you're doing it wrong. The dbutils.fs.ls will return python list. You're using substring function from pyspark.sql.functions which is not needed in this case. As an example, I created dsfd variable with following content
Then I can iterate over this list in the following way. Let's say that I only need path from dbutils.fs.ls output:
for row in dsfd:
print(row.path)
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.