Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
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)
Join Us as a Local Community Builder!
Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!