Ai Functions Usecase in PySpark | PySpark Interview Question

If you are interested in joining the paid Databricks Gen AI Project-Based Training, join this whatsapp group:https://chat.whatsapp.com/FPg397ZhTNP... 💡 Course Enrolment Link: https://www.geekcoders.co.in/courses/... Script: data = [ (1, "My payment failed and I was charged twice"), (2, "The app crashes every time I open it on iOS"), (3, "I want to cancel my subscription and get a refund"), (4, "How do I reset my password?"), (5, "The dashboard is loading very slowly"), ] df = spark.createDataFrame(data, ["ticket_id", "ticket_text"]) df.createOrReplaceTempView("tickets") classified_sql = ''' SELECT ticket_id, ticket_text, ai_classify(ticket_text, ARRAY( "Billing", "Engineering", "Customer Success", "Security", "Performance" )) AS department FROM tickets ''' classified = spark.sql(classified_sql) Databricks Live Training Project-Based Course link: https://www.geekcoders.co.in/courses/... #interview #kantara #dataengineering