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
1,483 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
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
33,920 views
0 votes
1 answer
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,730 points
3,369 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,730 points
405 views
0 votes
10 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
16,718 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
525 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 in Apache Spark by Firoz
398 views