Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AnalysisException: u'Cannot resolve column name

I am new to spark. I had parsed csv file into a dataframe. I am not able to select certain columns from the data frame. Following is the schema of my table: root

 |-- _c0: integer (nullable = true)
 |-- id: integer (nullable = true)
 |-- track_name: string (nullable = true)
 |-- size_bytes: long (nullable = true)
 |-- currency: string (nullable = true)
 |-- price: double (nullable = true)
 |-- rating_count_tot: integer (nullable = true)
 |-- rating_count_ver: integer (nullable = true)
 |-- user_rating: double (nullable = true)
 |-- user_rating_ver: double (nullable = true)
 |-- ver: string (nullable = true)
 |-- cont_rating: string (nullable = true)
 |-- prime_genre: string (nullable = true)
 |-- sup_devices.num: integer (nullable = true)
 |-- ipadSc_urls.num: integer (nullable = true)
 |-- lang.num: integer (nullable = true)
 |-- vpp_lic: integer (nullable = true)
 |-- Gigabytes: double (nullable = true)

While I am able to select some of the columns but when I am trying to select a column "ipadSc_urls.num" (one of the columns in the dataframe), I am getting an error.

error description

like image 233
Anuj Mahajan Avatar asked Sep 05 '25 19:09

Anuj Mahajan


1 Answers

Try to enclose column name in backquotes(`).

my_df.select('`ipadSc_urls.num`').show()
like image 112
notNull Avatar answered Sep 09 '25 02:09

notNull