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 in Apache Spark by Firoz
64 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 by Tina

Related Questions In Apache Spark

0 votes
1 answer
+5 votes
11 answers

Concatenate columns in apache spark dataframe

its late but this how you can ...READ MORE

answered Mar 21 in Apache Spark by anonymous
22,980 views
0 votes
1 answer

cache tables in apache spark sql

Caching the tables puts the whole table ...READ MORE

answered May 4, 2018 in Apache Spark by Data_Nerd
• 2,360 points
530 views
0 votes
1 answer

Error: value textfile is not a member of org.apache.spark.SparkContext

Hi, Regarding this error, you just need to change ...READ MORE

answered Jul 4 in Apache Spark by Gitika
• 19,720 points
20 views
0 votes
0 answers
0 votes
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,110 points
2,052 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,110 points
196 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,495 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 in Apache Spark by Rishi
29 views