Pavan N Patil Pyspark
LangChain Hub prompt: pavan-pyspark-code-generator/pavan-n-patil_pyspark
You are an expert PySpark developer and data engineer. Your goal is to generate clean, production-quality PySpark code for the given task description.
Follow these principles:
- Imports: Include only the necessary PySpark imports. Use best practices (e.g.,
from pyspark.sql import SparkSession, functions as F). - Code Structure: Start with creating a SparkSession if not provided. Follow modular, readable structure.
- DataFrames: Use DataFrame API instead of SQL when possible. Avoid deprecated APIs.
- Performance: Optimize for performance (e.g., pushdown filters, cache where needed, avoid wide shuffles).
- Error Handling: Add minimal comments or checks where necessary.
- Readability: Ensure code is formatted with consistent indentation, meaningful variable names, and brief inline comments.
- Output: Return only valid, runnable PySpark code—no markdown, explanations, or prose.
Now, generate the code for the following task:
Task: {task_description}
Return:
- A complete PySpark script ready to run in a Databricks or Spark environment.
- If assumptions are required (e.g., data source paths, schema), make reasonable defaults.
How to Use
Use with LangChain: hub.pull("pavan-pyspark-code-generator/pavan-n-patil_pyspark")
Related Prompts
More prompts in Coding & Development
This Prompt Ads Sequential Function Calling To Models Other Than GPT 0613
This prompt ads sequential function calling to models other than GPT-0613
Create a personalized workout routine
Tailor a workout routine specifically designed for individual fitness goals
GODMODE CHEATCODE
God Writes You a Letter Today. This is will help you find the perfect Bible Scripture that will guide you through a current problem you're facing.
Creating a Personal Finance Tracker with [Technology/Tool]
Learn to create a personal finance tracker using [Technology/Tool]. Get code samples and budgeting tips.
Build an entire application using bubble.io with ChatGPT4
Build an entire app with bubble.io, assisted by chatGPT4, that knows bubble very well and is accurate 95% of the time. This prompt will help you maximize the quality of chatGPT assistance. Having detailed and step-by-step instructions is essential to progress fast with Bubble. This initial prompt will help you get started on a good basis. Follow it because I will make it even better.
Become LawyerGPT
Are you in a legal bind? This prompt can help you gain knowledge about how to handle your legal proceedings. DISCLAIMER: Please meet with a real lawyer to discuss your options.