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
4,964 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 13, 2019 in Apache Spark by Puneet
6,223 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
1,408 views
+1 vote
1 answer
+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
• 10,870 points
4,499 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
• 10,870 points
640 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
25,301 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 10, 2019 in Apache Spark by Rishi
1,541 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
624 views