The Spark Python API (PySpark) exposes the apache-spark programming model to Python.
33,695 questions 1
- Bountied 1
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
Unable to launch pyspark with kafka when trying to import the kafka external package
I am trying to use pyspark with the following setup. pyspark version 3.2.1 spark version 3.2.1 hadoop version 3.2 jdk 11 So far, this setup works well. I am interested in working with Kafka, which ... java scala apache-spark pyspark apache-kafka
Zeruno
- 1,164
I want to use when on pyspark dataframe but i have multiple columns df.withcolumn [closed]
I have a column "Esc_char" if it is NULL. I want to use df.withColumm on 6-7 column and with when condition i can change only one column Any suggestions pyspark conditional-statements
Sonali Bisht
- 1
Convert Unix timing PySpark 13 digits
I've been trying to change the UNIX date (13 digits the one on the first column on the pic) to a readable date: from pyspark.sql import functions as F #TRY TO CHANGE THE DATA FORMAT sd = df.... apache-spark pyspark apache-spark-sql unix-timestamp dataformat
Federico Gottardi
- 19
PySpark structured streaming with window get earliest & latest record based upon a timestamp value
I have a structured streaming process that reads from a deltalake. The data contains values that are increasing with time. Within each window, I would like to get the (difference between the) earliest ... apache-spark pyspark timestamp spark-structured-streaming azure-synapse
Kermit754
- 261
PySpark - Handle csv file with a 3 character quote
I just loaded a csv file to work on a new script and I've noticed that the quotes in some of the columns are """sometext""", tried setting .option('quote', '""&... python csv pyspark
VigyX
- 1
Create columns with upper and lower borders obtained from list
I have a DataFrame and a list of borders: test = spark.createDataFrame( [ (1,), (2,), (234,), (0,), (6,), (7,), (35,), (46,), ... python list apache-spark pyspark apache-spark-sql
Bohdan Pylypenko
- 641
How to zip-package a python module for pyspark executor?
I am parsing Protobuf binary-messages from Kafka topic, using pyspark-streaming. My UDF is: def parse_protobuf_from_bytes(pb_bytes): data = contacts_pb2.Contacts() data.ParseFromString(... python apache-spark pyspark protocol-buffers
aiman
- 1,025
Adding a new column to a dataframe with a value which is based on the values from next rows
I have a dataframe as shown below, +-----+----------+---------+-------+-------------------+ |jobid|fieldmname|new_value|coltype| createat| +-----+----------+---------+-------+----------------... scala apache-spark pyspark
Mohana B C
- 3,994
DataBricks: Ingesting CSV data to a Delta Live Table in Python triggers "invalid charactres in table name" error - how to set column mapping mode?
First off, can I just say that I am learning DataBricks at the time of writing this post, so I'd like simpler, cruder solutions as well as more sophisticated ones. I am reading a CSV file like this: ... pyspark databricks delta-live-tables
Asfand Qazi
- 6,197
Unique element count in array column
I have this dataset with a column of array type. From this column, we need to create another column which will have list of unique elements and its counts. Example [a,b,e,b] results should be [[b,a,e],... python apache-spark pyspark apache-spark-sql user-defined-functions
Piyush Baranwal
- 19
Pyspark read file only if it exists
I have some parquet files in my hdfs directory /dir1/dir2/. The name of the files contain some timestamps but those are pretty random. For example, one file path is: /dir1/dir2/2022-06-16-03-12-36-086.... python-3.x apache-spark pyspark parquet
aishik roy chaudhury
- 129
pyspark performance and processing time
I have 5 steps which produced df_a,df_b,df_c,df_e and df_f. Each step generates a dataframe (df_a for instance), and persist as parquet files. The file is used in the sequential step (df_b for example)... pyspark apache-spark-sql query-optimization
NewPy
- 561
ThreadPoolExecutor executor script with questions
Hi the code below is what I have my question on. I am trying to fully understand/learn the code. 1.) What is (line 17) "row for row in " doing? 2.) Why are we writing "future_to_url[... python python-3.x pyspark
user1529514
- 71
Spark - Large Dataset ML -- How to set properties
Im hoping to get some basic information. I am using lightgbm on spark : and my data is large : about 40 ... apache-spark pyspark azure-synapse
B_Miner
- 1,716
Null value appeared in non-nullable field
I am trying to write the following pyspark dataframe to csv by using df_final.write.csv("v1_results/run1",header=True, emptyValue='',nullValue='') Please help me locate on why this issue ... pyspark
Sree Aurovindh
- 665
153050per page