org apache spark sql AnalysisException cannot resolve given input columns

0 votes

Hi Team,

While doing sql for one of the columns using this code:

val sqlDF = spark.sql("SELECT track_name,id,cont_rating FROM AppleStore_df_new_MB_GB where prime_genre=Productivity")

I am getting an error. 

org.apache.spark.sql.AnalysisException: cannot resolve given input columns: [toGB, size_bytes, prime_genre, user_rating_ver, track_name, _c0, price, rating_count_ver, user_rating, lang.num, sup_devices.num, toMB, id, rating_count_tot, vpp_lic, currency, ipadSc_urls.num, ver, cont_rating]; line 1 pos 80;
Jul 10, 2019 in Apache Spark by Firoz
42,866 views

1 answer to this question.

0 votes

The string Productivity has to be enclosed between single quotes. So, you need to execute the below statement to get the result,

val sqlDF = spark.sql("SELECT track_name,id,cont_rating FROM AppleStore_df_new_MB_GB where prime_genre = 'Productivity'")
answered Jul 10, 2019 by Tina

Related Questions In Apache Spark

0 votes
1 answer

org.apache.spark.sql.AnalysisException: cannot resolve "`id`" given input columns

I have used a header-less csv file ...READ MORE

answered Jul 14, 2019 in Apache Spark by Puneet
17,708 views
0 votes
1 answer
0 votes
1 answer

Spark: Error while instantiating "org.apache.spark.sql.hive.HiveSessionState"

Seems like you have not started the ...READ MORE

answered Jul 25, 2019 in Apache Spark by Rohit
8,205 views
+1 vote
2 answers
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,057 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,559 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,975 views
0 votes
2 answers

Error : split value is not a member of org.apache.spark.sql.Row

var d=rdd2col.rdd.map(x=>x.split(",")) or val names=rd ...READ MORE

answered Aug 5, 2020 in Apache Spark by Ramkumar Ramasamy.
11,972 views
0 votes
1 answer

Error : split value is not a member of org.apache.spark.sql.Row

spark.read.csv is used when loading into a ...READ MORE

answered Jul 22, 2019 in Apache Spark by Firoz
3,113 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP