AttributeError: 'list' object has no attribute 'columns' - PySpark
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 01:30 PM
Hi All,
i am getting the below error when i am ingesting the data from source file , source file is also attached , i have tried in both Community edition and Azure databricks as well getting the same error , can any one suggest me the solution ?
# reading a df for orders
orders_df = spark.read.json("/public/retail_db_json/orders").dtypes
# displaying the columns
orders_df.columns
# Error
AttributeError: 'list' object has no attribute 'columns'
Regards,
Rakesh