<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AttributeError: 'list' object has no attribute 'columns' - PySpark in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/attributeerror-list-object-has-no-attribute-columns-pyspark/m-p/29440#M21166</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 ? &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; # reading a df for orders
orders_df = spark.read.json("/public/retail_db_json/orders").dtypes
&amp;nbsp;
# displaying the columns 
orders_df.columns
&amp;nbsp;
# Error
AttributeError: 'list' object has no attribute 'columns'
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 20:30:13 GMT</pubDate>
    <dc:creator>db-avengers2rul</dc:creator>
    <dc:date>2022-10-03T20:30:13Z</dc:date>
    <item>
      <title>AttributeError: 'list' object has no attribute 'columns' - PySpark</title>
      <link>https://community.databricks.com/t5/data-engineering/attributeerror-list-object-has-no-attribute-columns-pyspark/m-p/29440#M21166</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 ? &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; # reading a df for orders
orders_df = spark.read.json("/public/retail_db_json/orders").dtypes
&amp;nbsp;
# displaying the columns 
orders_df.columns
&amp;nbsp;
# Error
AttributeError: 'list' object has no attribute 'columns'
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 20:30:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/attributeerror-list-object-has-no-attribute-columns-pyspark/m-p/29440#M21166</guid>
      <dc:creator>db-avengers2rul</dc:creator>
      <dc:date>2022-10-03T20:30:13Z</dc:date>
    </item>
  </channel>
</rss>

