Solve using PySpark and Spark-SQL | Accenture Interview Question |

preview_player
Показать описание
Write a Pyspark query to report the movies with an odd-numbered ID and a description that is not "boring".Return the result table in descending order by rating.

data=[(1, 'War','great 3D',8.9)
,(2, 'Science','fiction',8.5)
,(3, 'irish','boring',6.2)
,(4, 'Ice song','Fantacy',8.6)
,(5, 'House card','Interesting',9.1)]
schema="ID int,movie string,description string,rating double"

Course Link:

#pysparkinterview

#interviewquestion #pythonbeginners
#Geekcoders,#Sagarprajapati,#Freecontent,#Azure,#Dataengineer,#Python,SQL,Data,#Database,#Database,#Engineering,#Databricks,#Azuredatafactory,#Spark,#pythonlist
Рекомендации по теме
Комментарии
Автор

I saw this question on leetcode sql question series.

vikaschavan
Автор

Bro can you please tell me which software you are using to record screen.

fit
Автор

result_df = df.filter((col("ID") % 2 != 0) & (col("description") !=
display(result_df)

caferacerkid
Автор

Cool. The second syntax is DataFrame, not PySpark, as a Pyspark it could be also DataSet or RDD

SzalonyEdek
Автор

my Solution:

% 2 != 0) & (col("description") != "boring")).orderBy("rating", ascending=False)

AmitSingh-em
Автор

Hey Sagar, Please make delta live table related project. Delta live table is most demanding.

RajeshKumar-retj
Автор

from pyspark.sql.functions import col, upper
df_1 =
display(df_1)

SomwritaDe