id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_52527975 | stackoverflow | DATA_ENGINEERING | the kafka max.poll.records does not work in spark streaming | the kafka max.poll.records does not work in spark streaming
my spark streaming version is 2.0, the kafka version is 0.10.0.1,spark-streaming-kafka-0-10_2.11.
I use the direct way to get kafka records,I now want to limit the maximum number of messages I get in a batch. so I set the max.poll.records value,but it does... | https://stackoverflow.com/questions/52527975/the-kafka-max-poll-records-does-not-work-in-spark-streaming | apache-spark, apache-kafka, spark-streaming, kafka-consumer-api | 1,538,010,303 |
se_79913511 | stackoverflow | DATA_ENGINEERING | How to fix a cast invalid input error in Spark? | How to fix a cast invalid input error in Spark?
I'm trying to create & display a spark dataframe in Databricks. This is what my code looks like:
df = spark.sql(f'''
SELECT A.CUSTOMER_ID
FROM TABLE_1 A
INNER JOIN
TABLE_2 B
ON A.PRODUCT_ID = B.PRODUCT_ID
WHERE A.ORDER_... | https://stackoverflow.com/questions/79913511/how-to-fix-a-cast-invalid-input-error-in-spark | apache-spark, pyspark, databricks | 1,774,355,971 |
se_74233998 | stackoverflow | DATA_ENGINEERING | How to check owner of delta table in Databricks | How to check owner of delta table in Databricks
What query should i run to get details of owner of delta table in Databricks
I have tried describe table extended command it's showing owner as root | https://stackoverflow.com/questions/74233998/how-to-check-owner-of-delta-table-in-databricks | sql, amazon-web-services, apache-spark, pyspark, databricks | 1,666,952,711 |
se_79913284 | stackoverflow | DATA_ENGINEERING | What is Spark doing when one record is bigger than partition size? | What is Spark doing when one record is bigger than partition size?
I have a project where I ingest large jsons (100-300 MB per file) where one json is one record. I had issues with processing them until I increased spark.sql.files.maxPartitionBytes. I received Out of Memory errors all the time. What is Sparks mechanis... | https://stackoverflow.com/questions/79913284/what-is-spark-doing-when-one-record-is-bigger-than-partition-size | apache-spark, pyspark | 1,774,335,969 |
se_79899293 | stackoverflow | DATA_ENGINEERING | How to decide number of partitions using repartition vs coalesce in Apache Spark for optimization? | How to decide number of partitions using repartition vs coalesce in Apache Spark for optimization?
How to decide I am trying to understand how to properly use repartition and coalesce in Apache Spark, especially for performance optimization.
From my understanding:
repartition can increase or decrease partitions but c... | https://stackoverflow.com/questions/79899293/how-to-decide-number-of-partitions-using-repartition-vs-coalesce-in-apache-spark | apache-spark, pyspark, optimization | 1,772,441,198 |
se_79824080 | stackoverflow | DATA_ENGINEERING | Spark-Redis write loses rows when writing large DataFrame to Redis | Spark-Redis write loses rows when writing large DataFrame to Redis
I’m experiencing data loss when writing a large DataFrame to Redis using the Spark-Redis connector.
Details:
I have a DataFrame with millions of rows.
Writing to Redis works correctly for small DataFrames, but when the DataFrame is large, some rows s... | https://stackoverflow.com/questions/79824080/spark-redis-write-loses-rows-when-writing-large-dataframe-to-redis | python, apache-spark, pyspark, redis, spark-redis | 1,763,528,805 |
se_76385815 | stackoverflow | DATA_ENGINEERING | select random rows from the dataframe | select random rows from the dataframe
I have three dataframes that I have joined together to create a single dataframe.
df_1 = df_1.withColumn('idx', monotonically_increasing_id())
df_2 = df_2.withColumn('idx', monotonically_increasing_id())
df_3 = df_3.withColumn('DATE', to_timestamp('DATE')) \
.withColumn('i... | https://stackoverflow.com/questions/76385815/select-random-rows-from-the-dataframe | python, dataframe, apache-spark, pyspark | 1,685,654,692 |
se_43415812 | stackoverflow | DATA_ENGINEERING | java.util.zip.ZipException: invalid distance too far back | java.util.zip.ZipException: invalid distance too far back
I am new to spring boot. I have developed an app which uses an external jar file containing an apache's spark application. My app runs without any error when I run in my local computer. However, when creating a fat jar file and intending to run it in a server, ... | https://stackoverflow.com/questions/43415812/java-util-zip-zipexception-invalid-distance-too-far-back | apache-spark, spring-boot, zip | 1,492,188,702 |
se_79911582 | stackoverflow | DATA_ENGINEERING | How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion? | How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
I’m working on a streaming pipeline where data is coming from a Kafka topic, and I want to integrate LLM-based processing and RAG ingestion. I’m running into architectural challenges around latency ... | https://stackoverflow.com/questions/79911582/how-to-perform-asynchronous-llm-inference-on-kafka-streams-using-apache-spark-a | apache-spark, asynchronous, kafka-consumer-api, large-language-model, rag | 1,774,035,678 |
se_79911153 | stackoverflow | DATA_ENGINEERING | Spark JSON infer schema | Spark JSON infer schema
I have a JSON file like this:
{ "id": 1, "str": "a string", "d": "1996-11-20" }
I want Spark (version 4.0.1) to infer the schema and make column d a date, but that does not work:
scala> spark.read.option("inferSchema","true").option("dateFormat","yyyy-MM-dd").json("myfile.json").printSchema
... | https://stackoverflow.com/questions/79911153/spark-json-infer-schema | apache-spark | 1,773,994,313 |
se_79910630 | stackoverflow | DATA_ENGINEERING | How to change spark-submit command in intellij spark plugin | How to change spark-submit command in intellij spark plugin
In intellij I am trying to setup my spark plugin.
On my host I execute my code using
/<spark-home>/bin/spark3-submit .......
When I setup spark plugin on my intellij the command generated looks like below
/<spark-home>/bin/spark-submit .......
Essentially I w... | https://stackoverflow.com/questions/79910630/how-to-change-spark-submit-command-in-intellij-spark-plugin | apache-spark, intellij-idea, intellij-plugin | 1,773,920,344 |
se_79903459 | stackoverflow | DATA_ENGINEERING | Does Spark Catalyst Optimize Across Actions? | Does Spark Catalyst Optimize Across Actions?
Given the following scenario: DataFrame A, B, and C. B and C are retrieved from storage and operated on and joined to A = A*. Then a filter is applied to A* and written to one location, another filter is applied to A and written into second location. Two "actions" - write.
... | https://stackoverflow.com/questions/79903459/does-spark-catalyst-optimize-across-actions | apache-spark, pyspark | 1,773,003,926 |
se_76002778 | stackoverflow | DATA_ENGINEERING | I am running below code to run SQL procedure through Spark JDBC in python | I am running below code to run SQL procedure through Spark JDBC in python
I am running below code to run SQL procedure through Spark JDBC in python and getting error.
Parse error at line: 1, column: 15: Incorrect syntax near 'EXEC'.
Means some syntax error while executing EXEC [jarvis].[uspGetCreditOutputLatestTimeS... | https://stackoverflow.com/questions/76002778/i-am-running-below-code-to-run-sql-procedure-through-spark-jdbc-in-python | python, sql, apache-spark, pyspark, jdbc | 1,681,371,230 |
se_42370170 | stackoverflow | DATA_ENGINEERING | read data from HBase by using Spark with JAVA | read data from HBase by using Spark with JAVA
I want to access HBase via Spark using JAVA. I have not found any examples for this besides this one. In the answer is written,
You can also write this in Java
I copied this code from How to read from hbase using spark :
import org.apache.hadoop.hbase.client.{HBase... | https://stackoverflow.com/questions/42370170/read-data-from-hbase-by-using-spark-with-java | java, hadoop, apache-spark, hbase | 1,487,687,587 |
se_43610723 | stackoverflow | DATA_ENGINEERING | How to retrieve yarn's logs programmatically using java | How to retrieve yarn's logs programmatically using java
I actually retrieve my spark application's logs on a linux shell with :
yarn logs -applicationId applicationid
Is there any way to retrieve it programmatically using java ? | https://stackoverflow.com/questions/43610723/how-to-retrieve-yarns-logs-programmatically-using-java | java, hadoop, apache-spark, hadoop-yarn | 1,493,123,413 |
se_79904052 | stackoverflow | DATA_ENGINEERING | Spark 4.1.1 on AKS + Cosmos DB Cassandra API: ClassNotFound without connector, ClosedConnectionException with spark-cassandra-connector_2.13-3.5.1 | Spark 4.1.1 on AKS + Cosmos DB Cassandra API: ClassNotFound without connector, ClosedConnectionException with spark-cassandra-connector_2.13-3.5.1
We are upgrading a Spark job running on AKS (Kubernetes) from Spark 3.5.3 to Spark 4.1.1.
Current working setup (Spark 3.5.3):
Connector: com.datastax.spark:spark-cassandr... | https://stackoverflow.com/questions/79904052/spark-4-1-1-on-aks-cosmos-db-cassandra-api-classnotfound-without-connector-c | apache-spark, cassandra | 1,773,079,658 |
se_75136651 | stackoverflow | DATA_ENGINEERING | Stratified Sampling with Pyspark Multiples Columns | Stratified Sampling with Pyspark Multiples Columns
I have a dataframe with millions of registers, like this:
CLI_ID OCCUPA_ID DIG_LABEL
125 2705 1
328 2708 7
400 2712 1
401 2705 2
525 2708 1
I want to take an aleatory sample of 100k rows that contains 70% of 2705, 20% of 2708, ... | https://stackoverflow.com/questions/75136651/stratified-sampling-with-pyspark-multiples-columns | python, dataframe, apache-spark, pyspark, sample | 1,673,884,385 |
se_79894339 | stackoverflow | DATA_ENGINEERING | How to truly stream a 1GB+ XLSX file in Spark using Aspose LightCells without loading full XML into memory? | How to truly stream a 1GB+ XLSX file in Spark using Aspose LightCells without loading full XML into memory?
I am trying to process a very large XLSX file (~1GB compressed). After unzipping, the internal xl/worksheets/sheet1.xml is about 2.4GB.
I am using Spark (DataSource V2) and Aspose Cells LightCellsDataHandler in ... | https://stackoverflow.com/questions/79894339/how-to-truly-stream-a-1gb-xlsx-file-in-spark-using-aspose-lightcells-without-lo | scala, apache-spark, pyspark, aspose | 1,771,823,338 |
se_62874101 | stackoverflow | DATA_ENGINEERING | SPARK Parquet file loading with different schema | SPARK Parquet file loading with different schema
We have parquet files generated with two different schemas where we have ID and Amount fields.
File:
file1.snappy.parquet
ID: INT
AMOUNT: DECIMAL(15,6)
Content:
1,19500.00
2,198.34
file2.snappy.parquet
ID: INT
AMOUNT: DECIMAL(15,2)
Content:
1,19500.00
3,198.34
When I... | https://stackoverflow.com/questions/62874101/spark-parquet-file-loading-with-different-schema | apache-spark, apache-spark-sql, parquet | 1,594,636,800 |
se_61034251 | stackoverflow | DATA_ENGINEERING | Equivalent of pandas apply in pyspark? | Equivalent of pandas apply in pyspark?
I really want to be able to run complex functions over a whole column of a spark dataframe, as i would do in Pandas with the apply function.
For example, in Pandas I have an apply function that takes a messy domain like sub-subdomain.subdomain.facebook.co.nz/somequerystring and ... | https://stackoverflow.com/questions/61034251/equivalent-of-pandas-apply-in-pyspark | python, apache-spark, pyspark | 1,586,031,564 |
se_79262420 | stackoverflow | DATA_ENGINEERING | Spark JDBC Postgres with partitionColumn yields duplicate and missing rows | Spark JDBC Postgres with partitionColumn yields duplicate and missing rows
I am reading from my POSTGRES table using Spark JDBC with 10 connections, and using RNO as the partition column with boundaries ranging from 0 to the number of rows in the table.
This table is dynamic and increases every second.
The first step ... | https://stackoverflow.com/questions/79262420/spark-jdbc-postgres-with-partitioncolumn-yields-duplicate-and-missing-rows | postgresql, apache-spark | 1,733,659,751 |
se_79894817 | stackoverflow | DATA_ENGINEERING | Java heap space during long dataset handle cycle | Java heap space during long dataset handle cycle
I have a long dataset handle cycle. In this cycle on each iteration i map dataset rows (mapPartitions), then calculate some statistics (foreachPartition), until a certain condition is met.
It loocks like:
def handle(ds: Dataset[MyRow]): Dataset[MyRow] = {
var last =... | https://stackoverflow.com/questions/79894817/java-heap-space-during-long-dataset-handle-cycle | scala, apache-spark, jvm | 1,771,867,503 |
se_37655609 | stackoverflow | DATA_ENGINEERING | Spark write parquet not writing any files, only _SUCCESS | Spark write parquet not writing any files, only _SUCCESS
The application includes
val stats = sqlContext.sql("select id, n from myTable")
stats.write.parquet("myTable.parquet")
This creates dir myTable.parquet with no contents other than an empty _SUCCESS file, even that
stats.show // illustration only here, ori... | https://stackoverflow.com/questions/37655609/spark-write-parquet-not-writing-any-files-only-success | python, scala, apache-spark, apache-spark-sql, parquet | 1,465,210,578 |
se_79796232 | stackoverflow | DATA_ENGINEERING | Unexpected Write Behavior when using MERGE INTO/INSERT INTO Iceberg Spark Queries | Unexpected Write Behavior when using MERGE INTO/INSERT INTO Iceberg Spark Queries
I am observing different write behaviors when executing queries on EMR Notebook (correct behavior) vs when using spark-submit to submit a spark application to EMR Cluster (incorrect behavior).
When I am submitting Spark applications (wit... | https://stackoverflow.com/questions/79796232/unexpected-write-behavior-when-using-merge-into-insert-into-iceberg-spark-querie | apache-spark, pyspark, apache-spark-sql, amazon-emr, apache-iceberg | 1,761,080,306 |
se_79866787 | stackoverflow | DATA_ENGINEERING | Spark job fails with UnsafeExternalSorter OOM when using groupBy + collect_list + sort – how to optimize? | Spark job fails with UnsafeExternalSorter OOM when using groupBy + collect_list + sort – how to optimize?
How to replace groupBy + collect_list + array_sort with a more memory-efficient approach in Spark SQL?
I have a Spark (Java) batch job that processes large telecom event data
The job is failing with `SparkOutOfMem... | https://stackoverflow.com/questions/79866787/spark-job-fails-with-unsafeexternalsorter-oom-when-using-groupby-collect-list | java, apache-spark, kubernetes, pyspark, apache-spark-sql | 1,768,295,786 |
se_57851640 | stackoverflow | DATA_ENGINEERING | Window Vs GroupBy Performance in Spark | Window Vs GroupBy Performance in Spark
I am newbie to spark and I have observed that there are some cases that a window function approach and groupBy approach are alternatives for each other.Here,I want to understand from performance perspective which one is better and why?Both approaches will cause re-shuffling of da... | https://stackoverflow.com/questions/57851640/window-vs-groupby-performance-in-spark | scala, apache-spark | 1,568,022,820 |
se_60799994 | stackoverflow | DATA_ENGINEERING | Configure Hive metastore in my local Spark shell | Configure Hive metastore in my local Spark shell
I need to configure Hive metastore for use with Spark SQL in spark-shell.
I copied my hive-site.xml to spark/conf folder - it didn't work.
Then tried in spark shell
spark.conf.set("hive.metastore.uris","jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=t... | https://stackoverflow.com/questions/60799994/configure-hive-metastore-in-my-local-spark-shell | apache-spark, hive-metastore | 1,584,884,203 |
se_66320966 | stackoverflow | DATA_ENGINEERING | Pyspark toPandas() Out of bounds nanosecond timestamp error | Pyspark toPandas() Out of bounds nanosecond timestamp error
I am trying to convert a Spark DataFrame to Pandas. However, it is giving the following error:
OutOfBoundsDatetime: Out of bounds nanosecond timestamp:
Is there a work around for this?
It works if I drop all timestamp columns, but I would like to bring the wh... | https://stackoverflow.com/questions/66320966/pyspark-topandas-out-of-bounds-nanosecond-timestamp-error | python, pandas, apache-spark, pyspark, apache-spark-sql | 1,614,016,668 |
se_48634806 | stackoverflow | DATA_ENGINEERING | Converting Spark Scala Dataframe Column to Byte Array | Converting Spark Scala Dataframe Column to Byte Array
I'm attempting to write a Spark Scala DataFrame Column as an array of bytes.
I have a DataFrame that consists of two columns. The first column is a string and the second is a Map from Strings to Longs.
For example,
user_id | map
"ac2" | Map("c2" -> 1, "b3" -> 5... | https://stackoverflow.com/questions/48634806/converting-spark-scala-dataframe-column-to-byte-array | scala, apache-spark, jackson | 1,517,886,113 |
se_79886444 | stackoverflow | DATA_ENGINEERING | How do I speed up df.write from Spark to IBM DB2 | How do I speed up df.write from Spark to IBM DB2
Currently I am fetching live data from Kafka (Which produces 45k rows per second) into Spark, convert those rows into a dataframe (as the data coming in from Kafka is in JSON format) and trying to push it into DB2.
But the data throughput from Spark to DB2 is pretty low... | https://stackoverflow.com/questions/79886444/how-do-i-speed-up-df-write-from-spark-to-ibm-db2 | apache-spark, pyspark, db2 | 1,770,711,841 |
se_42834723 | stackoverflow | DATA_ENGINEERING | Missing application resource | Missing application resource
Use java to write the spark program, the code is as follows:
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
public class SimpleApp {
public static void ma... | https://stackoverflow.com/questions/42834723/missing-application-resource | java, maven, apache-spark | 1,489,668,913 |
se_47136075 | stackoverflow | DATA_ENGINEERING | SPARK SQL not in or NOT EXISTS | SPARK SQL not in or NOT EXISTS
I have a scenario where there are two sheets(csv). Created two tables for it.
When there s a good data I could map it with a value( id statistic value) from the second table. If I have bad data I should map it with id statistic value again (but a different value). however, I'm unable to... | https://stackoverflow.com/questions/47136075/spark-sql-not-in-or-not-exists | java, apache-spark | 1,509,968,098 |
se_46657518 | stackoverflow | DATA_ENGINEERING | Can spark yarn default queue run jobs in parallel | Can spark yarn default queue run jobs in parallel
I have two jobs submitted with default capability scheduler as following, but StagingDataset will not run until Thrift JDBC/ODBC Server got killed. Is there any way run two jobs in parallel in the same queue? | https://stackoverflow.com/questions/46657518/can-spark-yarn-default-queue-run-jobs-in-parallel | apache-spark, hadoop-yarn | 1,507,600,483 |
se_79812479 | stackoverflow | DATA_ENGINEERING | Can I update fs.s3a credentials in hadoop config on existing executors? | Can I update fs.s3a credentials in hadoop config on existing executors?
I have an application using EKS in AWS that runs a spark session that can run multiple workloads. In each workload, I need to access data from S3 in another AWS account, for which I have STS credentials. At the beginning of each workload, I run co... | https://stackoverflow.com/questions/79812479/can-i-update-fs-s3a-credentials-in-hadoop-config-on-existing-executors | amazon-web-services, apache-spark, hadoop, pyspark | 1,762,527,404 |
se_76351671 | stackoverflow | DATA_ENGINEERING | How can I make only one file in spark to s3? | How can I make only one file in spark to s3?
I have lots of csv files. After using spark sql, I want to make the one csv file.
For example I have news1.csv, news2.csv, news3.csv, ect in S3. I download into spark sql from s3, and createDataframe. After using spark sql, I want to upload s3 with only one csv file.
At fir... | https://stackoverflow.com/questions/76351671/how-can-i-make-only-one-file-in-spark-to-s3 | apache-spark, amazon-s3, pyspark | 1,685,279,486 |
se_64715335 | stackoverflow | DATA_ENGINEERING | merge into deltalake table updates all rows | merge into deltalake table updates all rows
i'm trying to update a deltalake table using a spark dataframe. What i want to do is to update all rows that are different in the spark dataframe than in the deltalake table, and to insert all rows that are missing from the deltalake table.
I tried to do this as follows:
imp... | https://stackoverflow.com/questions/64715335/merge-into-deltalake-table-updates-all-rows | scala, apache-spark, delta-lake | 1,604,668,471 |
se_66978126 | stackoverflow | DATA_ENGINEERING | PicklingError when using foreachPartition in Pyspark | PicklingError when using foreachPartition in Pyspark
I am attempting to map a function (which updates records in a Dynamodb table if a certain condition is met) to a large dataframe in Pyspark. I'm aware that functions are pickled and sent to executors, but I've been reading countless examples where the workaround is ... | https://stackoverflow.com/questions/66978126/picklingerror-when-using-foreachpartition-in-pyspark | apache-spark, pyspark, amazon-dynamodb | 1,617,755,285 |
se_79576707 | stackoverflow | DATA_ENGINEERING | Performance comparison between union and stack in spark | Performance comparison between union and stack in spark
In Spark, suppose i have the following df.
df = spark.createDataFrame([['A', 'A06', 'B', 'B02', '202412'], ['A', 'A04', 'B', 'B03', '202501'], ['B', 'B01', 'C', 'C02', '202411'], ['B', 'B03', 'A', 'A06', '202502']], 'entity_code: string, entity_rollup: string, ta... | https://stackoverflow.com/questions/79576707/performance-comparison-between-union-and-stack-in-spark | python, apache-spark, pyspark | 1,744,791,688 |
se_70447738 | stackoverflow | DATA_ENGINEERING | pyspark get latest non-null element of every column in one row | pyspark get latest non-null element of every column in one row
Let me explain my question using an example:
I have a dataframe:
pd_1 = pd.DataFrame({'day':[1,2,3,2,1,3],
'code': [10, 10, 20,20,30,30],
'A': [44, 55, 66,77,88,99],
'B':['a',None,'c',None,'d'... | https://stackoverflow.com/questions/70447738/pyspark-get-latest-non-null-element-of-every-column-in-one-row | python, dataframe, apache-spark, pyspark, apache-spark-sql | 1,640,169,713 |
se_79874277 | stackoverflow | DATA_ENGINEERING | Attempting to add a module-info.java to spark.core.2.13 of Apache Spark: how to make scala accepting module delaration and gather its classes? | Attempting to add a module-info.java to spark.core.2.13 of Apache Spark: how to make scala accepting module delaration and gather its classes?
I'm willing to progress into the subject of introducing java modules into Apache Spark. They are needed for:
sorting and avoiding conflicts between dependencies.
allow Spark ... | https://stackoverflow.com/questions/79874277/attempting-to-add-a-module-info-java-to-spark-core-2-13-of-apache-spark-how-to | java, scala, apache-spark, sbt, java-module | 1,769,143,038 |
se_32368976 | stackoverflow | DATA_ENGINEERING | Ways to make maven build faster? | Ways to make maven build faster?
I have a multi module java project. Maven takes almost around 40 secs to build it. I have tried maven with multi threaded builds too by specifying -T and -C args for no of threads and cores to be used. But I haven't seen any significant improvement in wall time of my builds.
I am usin... | https://stackoverflow.com/questions/32368976/ways-to-make-maven-build-faster | java, multithreading, scala, maven, apache-spark | 1,441,263,678 |
se_76908487 | stackoverflow | DATA_ENGINEERING | Create an interaction between two categorical columns in PySpark | Create an interaction between two categorical columns in PySpark
I have two multi-level categorical columns stored in df:
dow represents the day of week (seven categories mapped to integers: 1, 2, ..., 7).
type represents four types of observation (four categories mapped to integers: 1, 2, 3, 4).
How can I create an... | https://stackoverflow.com/questions/76908487/create-an-interaction-between-two-categorical-columns-in-pyspark | python, apache-spark, pyspark | 1,692,125,851 |
se_79872561 | stackoverflow | DATA_ENGINEERING | PySpark .show() fails with “Python worker exited unexpectedly” on Windows (Python 3.14) | PySpark .show() fails with “Python worker exited unexpectedly” on Windows (Python 3.14)
Body
I am facing a PySpark error on Windows while calling .show() on a DataFrame. The job fails with a Python worker crash.
Environment
OS: Windows 10
Spark: Apache Spark (PySpark)
IDE: VS Code
Python version: 3.14
Code
error... | https://stackoverflow.com/questions/79872561/pyspark-show-fails-with-python-worker-exited-unexpectedly-on-windows-pytho | python, apache-spark, pyspark | 1,768,975,191 |
se_79871113 | stackoverflow | DATA_ENGINEERING | Interplay between spark's decommissioning and PVC re-use functions | Interplay between spark's decommissioning and PVC re-use functions
I'm currently evaluating using PVCs as ephemeral storage in Spark in order to reduce costs and enable running on spot instances. As of Spark 3.5, it's possible to use either the decommissioning feature to copy shuffle and cache data to other execut... | https://stackoverflow.com/questions/79871113/interplay-between-sparks-decommissioning-and-pvc-re-use-functions | apache-spark | 1,768,819,589 |
se_65256627 | stackoverflow | DATA_ENGINEERING | How to make two columns from 1 column while dividing data between them in spark? | How to make two columns from 1 column while dividing data between them in spark?
val rdd= sc.parallelize(List(41,42,43,44,45,46,47,48,49,50))
val df = rdd.toDF("numbers")
val now = what.select(when($"numbers" % 2===0,$"numbers").otherwise("").as("Even"),
when($"numbers"%2===1,$"numbers").otherw... | https://stackoverflow.com/questions/65256627/how-to-make-two-columns-from-1-column-while-dividing-data-between-them-in-spark | scala, apache-spark, apache-spark-sql, rdd, case-when | 1,607,710,783 |
se_79869785 | stackoverflow | DATA_ENGINEERING | KubernetesExecutor, Airflow 3,SparkSubmitOperator with pod_overwrite fails with json validation error | KubernetesExecutor, Airflow 3,SparkSubmitOperator with pod_overwrite fails with json validation error
I'm trying to figure out how to successfully run dag with SparkSubmitOperator on Airflow 3.1.5,
I have a wrapper which sets pod config:
self.executor_config = {
"pod_override": k8s.V1Pod(
m... | https://stackoverflow.com/questions/79869785/kubernetesexecutor-airflow-3-sparksubmitoperator-with-pod-overwrite-fails-with | apache-spark, airflow | 1,768,597,711 |
se_44700789 | stackoverflow | DATA_ENGINEERING | How to unit-test a class is serializable for spark? | How to unit-test a class is serializable for spark?
I just found a bug on a class serialization in spark.
=> Now, I want to make a unit-test, but I don't see how?
Notes:
the failure appends in a (de)serialized object which has been broadcasted.
I want to test exactly what spark will do, to assert it will work on... | https://stackoverflow.com/questions/44700789/how-to-unit-test-a-class-is-serializable-for-spark | scala, unit-testing, apache-spark, serialization, kryo | 1,498,138,063 |
se_79868082 | stackoverflow | DATA_ENGINEERING | Can't SELECT anything in a AWS Glue Data Catalog view due to invalid view text: <REDACTED VIEW TEXT> | Can't SELECT anything in a AWS Glue Data Catalog view due to invalid view text: <REDACTED VIEW TEXT>
i created a glue view through a glue job like this:
CREATE OR REPLACE PROTECTED MULTI DIALECT VIEW risk_models_output.vw_behavior_special_limit_score
SECURITY DEFINER AS
[query here...]
b... | https://stackoverflow.com/questions/79868082/cant-select-anything-in-a-aws-glue-data-catalog-view-due-to-invalid-view-text | apache-spark, apache-spark-sql, aws-glue | 1,768,423,042 |
se_79863218 | stackoverflow | DATA_ENGINEERING | How to run Pyspark UDF separately over dataframe groups | How to run Pyspark UDF separately over dataframe groups
Grouping a Pyspark dataframe, applying time series analysis UDF to each group
SOLVED See below
I have a Pyspark process which takes a time-series dataframe for a site and calculates/adds features for anomaly detection. Window functions are used to compare leadi... | https://stackoverflow.com/questions/79863218/how-to-run-pyspark-udf-separately-over-dataframe-groups | python, pandas, dataframe, apache-spark, pyspark | 1,767,869,578 |
se_79867782 | stackoverflow | DATA_ENGINEERING | Cannot attach VS Code to Spark container: Permission denied creating .vscode-server in /nonexistent | Cannot attach VS Code to Spark container: Permission denied creating .vscode-server in /nonexistent
I'm getting what I feel should be a super simple error, but I'm having a tough time figuring out what I'm doing wrong. I want to open a running container in VS Code, but I keep getting a permission error. Help would be ... | https://stackoverflow.com/questions/79867782/cannot-attach-vs-code-to-spark-container-permission-denied-creating-vscode-ser | docker, apache-spark, visual-studio-code, docker-desktop, vscode-devcontainer | 1,768,397,103 |
se_79867255 | stackoverflow | DATA_ENGINEERING | How to make spark reuse python workers where we have done some costly init set up? | How to make spark reuse python workers where we have done some costly init set up?
I'm trying to optimize execute pandas UDF's in PySpark. When I start the UDF, I do some costly initializations - like loading an ML model. This is a one time operation and I don't want to do this repeatedly. I want to reuse the python w... | https://stackoverflow.com/questions/79867255/how-to-make-spark-reuse-python-workers-where-we-have-done-some-costly-init-set-u | python, apache-spark, pyspark | 1,768,330,306 |
se_76006719 | stackoverflow | DATA_ENGINEERING | Loking for a way to Store and process Raw NetCDF files (scientific data) on With HDFS and MapReduce or Spark? | Loking for a way to Store and process Raw NetCDF files (scientific data) on With HDFS and MapReduce or Spark?
I'm actually working on a spatial big data project (NetCDF files) and I want to store this data on hdfs and process it with mapreduce or spark, so that users send queries sash as AVG, mean of variables by dime... | https://stackoverflow.com/questions/76006719/loking-for-a-way-to-store-and-process-raw-netcdf-files-scientific-data-on-with | apache-spark, hadoop, hive | 1,681,396,602 |
se_79393946 | stackoverflow | DATA_ENGINEERING | Spark SELECT Query Ignores Partition Filters in java spark App but Works in Zeppelin | Spark SELECT Query Ignores Partition Filters in java spark App but Works in Zeppelin
I'm running a Spark SELECT query on a Delta Lake table partitioned by year, month, day, and hour, derived from a timestamp column. When I execute the query in Zeppelin, Spark is aware of the partitions and applies partition filters as... | https://stackoverflow.com/questions/79393946/spark-select-query-ignores-partition-filters-in-java-spark-app-but-works-in-zepp | apache-spark, apache-spark-sql, parquet, delta-lake | 1,738,069,728 |
se_79866196 | stackoverflow | DATA_ENGINEERING | Ensure two queries in a Spark declarative pipeline process the same rows when using the availableNow trigger | Ensure two queries in a Spark declarative pipeline process the same rows when using the availableNow trigger
I'm using Spark declarative pipelines in Databricks. My pipeline runs in triggered mode. My understanding is that in triggered mode, the streaming uses the availableNow=True option to process all data that was ... | https://stackoverflow.com/questions/79866196/ensure-two-queries-in-a-spark-declarative-pipeline-process-the-same-rows-when-us | apache-spark, pyspark, databricks, spark-streaming | 1,768,227,363 |
se_79866500 | stackoverflow | DATA_ENGINEERING | How to display a greater number of completed jobs in Databrick's Spark UI? | How to display a greater number of completed jobs in Databrick's Spark UI?
To improve the performance of a databricks workflow, I need to analyse Spark UI. However, my workflows has 1295 jobs and Spark UI on Databricks only shows 904 jobs as you can see on the following image:
Is there any configuration on Databr... | https://stackoverflow.com/questions/79866500/how-to-display-a-greater-number-of-completed-jobs-in-databricks-spark-ui | apache-spark, databricks, azure-databricks, spark-ui | 1,768,254,771 |
se_49492463 | stackoverflow | DATA_ENGINEERING | Compute size of Spark dataframe - SizeEstimator gives unexpected results | Compute size of Spark dataframe - SizeEstimator gives unexpected results
I am trying to find a reliable way to compute the size (in bytes) of a Spark dataframe programmatically.
The reason is that I would like to have a method to compute an "optimal" number of partitions ("optimal" could mean different things here: ... | https://stackoverflow.com/questions/49492463/compute-size-of-spark-dataframe-sizeestimator-gives-unexpected-results | apache-spark, apache-spark-sql | 1,522,070,320 |
se_58822133 | stackoverflow | DATA_ENGINEERING | How to create a persistent view from a pyspark dataframe | How to create a persistent view from a pyspark dataframe
I have a pyspark dataframe df, and would like to save it as a persistent view. Is that possible?
I tried to do the following:
df.createOrReplaceTempView("temp_view")
spark.sql('CREATE VIEW my_view AS SELECT * FROM temp_view'))
And I got the following error ... | https://stackoverflow.com/questions/58822133/how-to-create-a-persistent-view-from-a-pyspark-dataframe | python, apache-spark, pyspark | 1,573,573,761 |
se_78978620 | stackoverflow | DATA_ENGINEERING | Spark 3.0 Cannot write non-nullable data to iceberg | Spark 3.0 Cannot write non-nullable data to iceberg
I have an Avro file which has a field called timeStamp, which is a mandatory field without any default value. Which means there is no chance of getting this field as null. The schema is defined as below
{"name": "timestamp","type": {"type": "long", "logicalType":... | https://stackoverflow.com/questions/78978620/spark-3-0-cannot-write-non-nullable-data-to-iceberg | apache-spark, apache-spark-sql, spark-streaming, spark-structured-streaming, apache-iceberg | 1,726,150,986 |
se_79864256 | stackoverflow | DATA_ENGINEERING | scala.MatchError: TimestampNTZType (of class org.apache.spark.sql.types.TimestampNTZType$) | scala.MatchError: TimestampNTZType (of class org.apache.spark.sql.types.TimestampNTZType$)
We are using Kafka to get avro data with the help of schema registry. After upgrading to Spark 3.3.2 from 2.4 the kafka consumer is failing with error -
scala.MatchError: TimestampNTZType (of class org.apache.spark.sql.types.Tim... | https://stackoverflow.com/questions/79864256/scala-matcherror-timestampntztype-of-class-org-apache-spark-sql-types-timestam | scala, apache-spark, apache-kafka, avro, confluent-schema-registry | 1,767,959,695 |
se_79793050 | stackoverflow | DATA_ENGINEERING | SQLSTATE: 42K0I error when connecting Databricks to ADLS | SQLSTATE: 42K0I error when connecting Databricks to ADLS
could someone help me with connecting Databricks with ADLS? I have tried connecting with (as suppose) all the ways I could - SAS Token, Service Principle or even one more way I don't really remember the name. All of these were - according to many YT step-by-step... | https://stackoverflow.com/questions/79793050/sqlstate-42k0i-error-when-connecting-databricks-to-adls | azure, apache-spark, azure-databricks | 1,760,703,664 |
se_30926785 | stackoverflow | DATA_ENGINEERING | Spark DataFrames: registerTempTable vs not | Spark DataFrames: registerTempTable vs not
I just started with DataFrame yesterday and am really liking it so far.
I dont understand one thing though...
(Referring to the example under "Programmatically Specifying the Schema" here: https://spark.apache.org/docs/latest/sql-programming-guide.html#programmatically-speci... | https://stackoverflow.com/questions/30926785/spark-dataframes-registertemptable-vs-not | apache-spark, dataframe | 1,434,665,969 |
se_49785108 | stackoverflow | DATA_ENGINEERING | Spark streaming with python: how to add a UUID column? | Spark streaming with python: how to add a UUID column?
I would like to add a column with a generated id to my data frame. I have tried:
uuidUdf = udf(lambda x: str(uuid.uuid4()), StringType())
df = df.withColumn("id", uuidUdf())
however, when I do this, nothing is written to my output directory. When I remove these... | https://stackoverflow.com/questions/49785108/spark-streaming-with-python-how-to-add-a-uuid-column | python, apache-spark, pyspark, uuid | 1,523,484,498 |
se_52562607 | stackoverflow | DATA_ENGINEERING | recursive cte in spark SQL | recursive cte in spark SQL
; WITH Hierarchy as
(
select distinct PersonnelNumber
, Email
, ManagerEmail
from dimstage
union all
select e.PersonnelNumber
, e.Email
, e.ManagerEmail
from dim... | https://stackoverflow.com/questions/52562607/recursive-cte-in-spark-sql | apache-spark, apache-spark-sql, spark-notebook | 1,538,168,356 |
se_77040014 | stackoverflow | DATA_ENGINEERING | AnalysisException: Found duplicate column(s) in the data to save | AnalysisException: Found duplicate column(s) in the data to save
I'm trying to insert a dataframe's values inside an SQL table on Databricks.
The thing is, there is no (apparent) duplicate columns in the dataframe. I checked. What this could be?
|-- nr_cpf_cnpj: string (nullable = true)
|-- tp_pess: string (nullable... | https://stackoverflow.com/questions/77040014/analysisexception-found-duplicate-columns-in-the-data-to-save | apache-spark, pyspark, apache-spark-sql, databricks | 1,693,853,368 |
se_44764743 | stackoverflow | DATA_ENGINEERING | How to run Spark standalone on Kubernetes? | How to run Spark standalone on Kubernetes?
I have a Scala application that is using Spark 2.1 in standalone mode. The application will run for 2 hours and finish. It should be run once a month.
I found several approaches to combine Spark and Kubernetes:
Use Apache Spark Helm Chart: https://github.com/kubernetes/ch... | https://stackoverflow.com/questions/44764743/how-to-run-spark-standalone-on-kubernetes | scala, apache-spark, kubernetes | 1,498,496,085 |
se_40395932 | stackoverflow | DATA_ENGINEERING | Spark fillNa not replacing the null value | Spark fillNa not replacing the null value
I have the following dataset and its contain some null values, need to replace the null value using fillna in spark.
DataFrame:
df = spark.read.format("com.databricks.spark.csv").option("header","true").load("/sample.csv")
>>> df.printSchema();
root
|-- Age: string (nu... | https://stackoverflow.com/questions/40395932/spark-fillna-not-replacing-the-null-value | apache-spark, pyspark | 1,478,157,937 |
se_52287553 | stackoverflow | DATA_ENGINEERING | How to create a copy of a dataframe in pyspark? | How to create a copy of a dataframe in pyspark?
I have a dataframe from which I need to create a new dataframe with a small change in the schema by doing the following operation.
>>> X = spark.createDataFrame([[1,2], [3,4]], ['a', 'b'])
>>> schema_new = X.schema.add('id_col', LongType(), False)
>>> _X = X.rdd.zipWith... | https://stackoverflow.com/questions/52287553/how-to-create-a-copy-of-a-dataframe-in-pyspark | python, apache-spark, pyspark, apache-spark-sql | 1,536,726,909 |
se_79510306 | stackoverflow | DATA_ENGINEERING | Why does a Parquet file written with Polars query faster than one written with Spark? | Why does a Parquet file written with Polars query faster than one written with Spark?
I am writing Parquet files using two different frameworks—Apache Spark (Scala) and Polars (Python)—with the same schema and data. However, when I query the resulting Parquet files using Apache DataFusion, I notice a significant perfo... | https://stackoverflow.com/questions/79510306/why-does-a-parquet-file-written-with-polars-query-faster-than-one-written-with-s | python, apache-spark, pyspark, parquet, python-polars | 1,741,989,627 |
se_43411234 | stackoverflow | DATA_ENGINEERING | spark sql - whether to use row transformation or UDF | spark sql - whether to use row transformation or UDF
I am having an input table (I) with 100 columns and 10 million records. I want to get an output table (O) that has 50 columns and these columns are derived from columns of I i.e. there will be 50 functions that map column(s) of I to 50 columns of O i.e. o1 = f(i1) ,... | https://stackoverflow.com/questions/43411234/spark-sql-whether-to-use-row-transformation-or-udf | sql, apache-spark, apache-spark-sql, user-defined-functions | 1,492,171,699 |
se_79655243 | stackoverflow | DATA_ENGINEERING | PySpark Autoloader: How to enforce schema and fail on mismatch? | PySpark Autoloader: How to enforce schema and fail on mismatch?
Hi all I am using Databricks Autoloader with PySpark to ingest Parquet files from a directory. Here's a simplified version of my current setup:
spark.readStream \
.format("cloudFiles") \
.option("cloudFiles.format", "parquet") \
.load("path") \
.writeStre... | https://stackoverflow.com/questions/79655243/pyspark-autoloader-how-to-enforce-schema-and-fail-on-mismatch | apache-spark, pyspark, databricks, spark-streaming, databricks-autoloader | 1,749,161,222 |
se_79854841 | stackoverflow | DATA_ENGINEERING | Why 2 tables bucketed by col1 and joined by (col1, col2) are shuffled? | Why 2 tables bucketed by col1 and joined by (col1, col2) are shuffled?
// Enable all bucketing optimizations
spark.conf.set("spark.sql.requireAllClusterKeysForDistribution", "false")
spark.conf.set("spark.sql.sources.bucketing.enabled", "true")
spark.conf.set("spark.sql.bucketing.coalesceBucketsInJoi... | https://stackoverflow.com/questions/79854841/why-2-tables-bucketed-by-col1-and-joined-by-col1-col2-are-shuffled | apache-spark, optimization, apache-spark-sql, shuffle, bucketing | 1,766,664,205 |
se_79854793 | stackoverflow | DATA_ENGINEERING | 'JavaPackage' object is not callable error when trying to getOrCreate() local spark session | 'JavaPackage' object is not callable error when trying to getOrCreate() local spark session
I have set up a small Xubuntu machine with intention of making it my single-node playaround Spark cluster. The cluster seems to be set up correctly - I can access the WebUI at port 8080, it shows a single worker attache... | https://stackoverflow.com/questions/79854793/javapackage-object-is-not-callable-error-when-trying-to-getorcreate-local-sp | python, apache-spark, ubuntu, pyspark | 1,766,658,166 |
se_79799328 | stackoverflow | DATA_ENGINEERING | Spark OutOfMemoryError when reading large JSON file (3.5GB) as wholeText due to colon in path | Spark OutOfMemoryError when reading large JSON file (3.5GB) as wholeText due to colon in path
I’m trying to load JSON data into an Iceberg table. The source files are named with timestamps that include colons (:), so I need to read them as plain text first. Additionally, each file is in a pretty-printed JSON format, w... | https://stackoverflow.com/questions/79799328/spark-outofmemoryerror-when-reading-large-json-file-3-5gb-as-wholetext-due-to | json, apache-spark, pyspark, out-of-memory, apache-iceberg | 1,761,368,195 |
se_61265350 | stackoverflow | DATA_ENGINEERING | Spark MergeSchema on parquet columns | Spark MergeSchema on parquet columns
For schema evolution Mergeschema can be used in Spark for Parquet file formats, and I have below clarifications on this
Does this support only Parquet file format or any other file formats like csv,txt files.
If new additional columns are added in between I understand Mergesche... | https://stackoverflow.com/questions/61265350/spark-mergeschema-on-parquet-columns | scala, azure, apache-spark, databricks | 1,587,104,796 |
se_39381041 | stackoverflow | DATA_ENGINEERING | Determining optimal number of Spark partitions based on workers, cores and DataFrame size | Determining optimal number of Spark partitions based on workers, cores and DataFrame size
There are several similar-yet-different concepts in Spark-land surrounding how work gets farmed out to different nodes and executed concurrently. Specifically, there is:
The Spark Driver node (sparkDriverCount)
The number of wo... | https://stackoverflow.com/questions/39381041/determining-optimal-number-of-spark-partitions-based-on-workers-cores-and-dataf | apache-spark, apache-spark-sql, distributed-computing, partitioning, bigdata | 1,473,296,229 |
se_63824121 | stackoverflow | DATA_ENGINEERING | Set path file as parameter didn’t work in python pyspark | Set path file as parameter didn’t work in python pyspark
I want to run a code where it can ingest the data using jdbc driver and save it into a file path. It successfully ingested the data but the saving function didn’t work. I know that we can use code like this to save data:
a.write.mode("overwrite").parquet("test/p... | https://stackoverflow.com/questions/63824121/set-path-file-as-parameter-didn-t-work-in-python-pyspark | python, apache-spark, pyspark, data-ingestion | 1,599,720,235 |
se_39383557 | stackoverflow | DATA_ENGINEERING | Show distinct column values in pyspark dataframe | Show distinct column values in pyspark dataframe
With pyspark dataframe, how do you do the equivalent of Pandas df['col'].unique().
I want to list out all the unique values in a pyspark dataframe column.
Not the SQL type way (registertemplate then SQL query for distinct values).
Also I don't need groupby then countDis... | https://stackoverflow.com/questions/39383557/show-distinct-column-values-in-pyspark-dataframe | python, apache-spark, pyspark, apache-spark-sql | 1,473,314,622 |
se_34271398 | stackoverflow | DATA_ENGINEERING | Flatten Nested Spark Dataframe | Flatten Nested Spark Dataframe
Is there a way to flatten an arbitrarily nested Spark Dataframe? Most of the work I'm seeing is written for specific schema, and I'd like to be able to generically flatten a Dataframe with different nested types (e.g. StructType, ArrayType, MapType, etc).
Say I have a schema like:
Stru... | https://stackoverflow.com/questions/34271398/flatten-nested-spark-dataframe | apache-spark, pyspark, apache-spark-sql | 1,450,108,735 |
se_62054867 | stackoverflow | DATA_ENGINEERING | How to concatenate columns in previous row in dataframe? | How to concatenate columns in previous row in dataframe?
I have a dataframe like this:
case class CC(id: String, p2: Double, p3: Double, time: Int)
val df = List(
CC("a", 1.1d, 2.2d, 1),
CC("b", 3.3d, 4.4d, 2),
CC("c", 5.5d, 6.6d, 3)).toDF
+---+---+---+----+
| id| p2| p3|time|
+---+---+---+----+
| a|1.1|2.2| ... | https://stackoverflow.com/questions/62054867/how-to-concatenate-columns-in-previous-row-in-dataframe | scala, dataframe, apache-spark, functional-programming | 1,590,624,477 |
se_41183882 | stackoverflow | DATA_ENGINEERING | How to make pointers be four bytes instead of eight | How to make pointers be four bytes instead of eight
I am reading in the spark documentation that I can set the pointers size.
I have to use the JVM flag:-XX:+UseCompressedOops, but it is not clear for me how I have to insert it in the spark-env.sh file. Can I set this flag by code? | https://stackoverflow.com/questions/41183882/how-to-make-pointers-be-four-bytes-instead-of-eight | apache-spark, jvm | 1,481,889,406 |
se_79587373 | stackoverflow | DATA_ENGINEERING | Disable printing info when running spark-sql | Disable printing info when running spark-sql
I'm running sql commands with spark-sql. I have put rootLogger.level = off in log4j2.properties file, but I'm still getting some info messages:
Spark Web UI available at http://computer:4040
Spark master: local[*], Application Id: local-1745351583376
1
Time taken: 1.559 sec... | https://stackoverflow.com/questions/79587373/disable-printing-info-when-running-spark-sql | apache-spark, pyspark, apache-spark-sql | 1,745,352,385 |
se_79815482 | stackoverflow | DATA_ENGINEERING | trying to read bigquery array colum and passing it as columns to fetch from spark dataframe | trying to read bigquery array colum and passing it as columns to fetch from spark dataframe
I have a bigquery table with array column named as "column_list "
ALTER TABLE `test-project.TEST_DATASET.TEST_TABLE`
ADD COLUMN column_list ARRAY<STRING>;
update `test-project.TEST_DATASET.TEST_TABLE`
set column_list = ARRAY_C... | https://stackoverflow.com/questions/79815482/trying-to-read-bigquery-array-colum-and-passing-it-as-columns-to-fetch-from-spar | scala, apache-spark | 1,762,770,532 |
se_79846955 | stackoverflow | DATA_ENGINEERING | Difference between org.apache.hadoop.io.compress.CompressionCodec and org.apache.spark.io.CompressionCodec | Difference between org.apache.hadoop.io.compress.CompressionCodec and org.apache.spark.io.CompressionCodec
I want to use a compression in bigdata processing, but there are two compression codecs.
Anyone know the difference? | https://stackoverflow.com/questions/79846955/difference-between-org-apache-hadoop-io-compress-compressioncodec-and-org-apache | apache-spark, hadoop | 1,765,706,712 |
se_62198911 | stackoverflow | DATA_ENGINEERING | Not Able to Run PySpark in Google Colab | Not Able to Run PySpark in Google Colab
hi I am trying to run PySpark on Google Colab using following code:
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q http://apache.osuosl.org/spark/spark-2.4.5/spark-2.4.5-bin-hadoop2.7.tgz
!tar xf spark-2.4.5-bin-hadoop2.7.tgz
!pip install -q findspark
import o... | https://stackoverflow.com/questions/62198911/not-able-to-run-pyspark-in-google-colab | python, apache-spark, pyspark, jupyter-notebook, google-colaboratory | 1,591,285,933 |
se_53146855 | stackoverflow | DATA_ENGINEERING | How to efficiently group every k rows in spark dataset? | How to efficiently group every k rows in spark dataset?
I created a spark Dataset[Row], and the Row is Row(x: Vector). x here is a 1xp vector.
Is it possible to 1) group every k rows 2) concatenating these rows into a k x p matrix - mX i.e., change Dateset[Row(Vector)] to Dateset[Row(Matrix)] ?
Here is my current solu... | https://stackoverflow.com/questions/53146855/how-to-efficiently-group-every-k-rows-in-spark-dataset | apache-spark, dataset, rdd | 1,541,377,695 |
se_79848623 | stackoverflow | DATA_ENGINEERING | spark flatMapToPair reaching "no space left on device" due to large duplication of entries | spark flatMapToPair reaching "no space left on device" due to large duplication of entries
First, my question is not on increasing disk space to avoid no space left error, but to understand what spark does, and hopefully how to improve my code.
In short, here is the pseudo code:
JavaRDD<Entry> input = ... ... | https://stackoverflow.com/questions/79848623/spark-flatmaptopair-reaching-no-space-left-on-device-due-to-large-duplication | apache-spark, flatmap | 1,765,896,444 |
se_72370888 | stackoverflow | DATA_ENGINEERING | Generate Random Hexidecimal in Scala? | Generate Random Hexidecimal in Scala?
How can I generate a random hexadecimal in scala?
The purpose it to essentially to use this as a UDF to generate random 64 char hexadecimals per column in a DataFrame.
I understand one can utilize below for an Int and etc:
val r = scala.util.Random
println(r.nextInt)
Is there an... | https://stackoverflow.com/questions/72370888/generate-random-hexidecimal-in-scala | scala, apache-spark, random | 1,653,439,563 |
se_79682572 | stackoverflow | DATA_ENGINEERING | Spark DSv2 Options vs Properties | Spark DSv2 Options vs Properties
I'm playing around with making a DSv2 data source, and I'm a bit confused about what the differences between the "options" and "properties" args passed to some of the TableProvider functions are supposed to be.
/**
* Infer the schema of the table identified by the given options.
*
* @p... | https://stackoverflow.com/questions/79682572/spark-dsv2-options-vs-properties | java, apache-spark | 1,751,065,298 |
se_79444608 | stackoverflow | DATA_ENGINEERING | How to package separate dependencies for driver and executor in pyspark? | How to package separate dependencies for driver and executor in pyspark?
I am looking various approaches for pyspark package management. I went through https://spark.apache.org/docs/latest/api/python/user_guide/python_packaging.html . As per my understanding, the zip file will be downloaded both in driver and executor... | https://stackoverflow.com/questions/79444608/how-to-package-separate-dependencies-for-driver-and-executor-in-pyspark | apache-spark, pyspark, pip | 1,739,774,803 |
se_79827325 | stackoverflow | DATA_ENGINEERING | Spark with Delta Lake and S3A: NumberFormatException "60s" and request for working Docker image/config | Spark with Delta Lake and S3A: NumberFormatException "60s" and request for working Docker image/config
I’m trying to create a Delta Lake table in MinIO using Spark 4.0.0 inside a Docker container. I’ve added the required JARs:
delta-spark_2.13-4.0.0.jar
delta-storage-4.0.0.jar
hadoop-aws-3.3.6.jar
aws-java-... | https://stackoverflow.com/questions/79827325/spark-with-delta-lake-and-s3a-numberformatexception-60s-and-request-for-worki | docker, apache-spark, pyspark, minio, delta | 1,763,816,046 |
se_79623158 | stackoverflow | DATA_ENGINEERING | Unpredictable exception while querying clickhouse database via JDBC driver | Unpredictable exception while querying clickhouse database via JDBC driver
I'm facing a problem that doesn't always occur, and therefore, it is difficult to reproduce and resolve.
Here is some key information about the env:
OS: Rocky Linux 9.2 (Blue Onyx)
Language: Scala 2.13.13
Main dependencies involved:
"com.clic... | https://stackoverflow.com/questions/79623158/unpredictable-exception-while-querying-clickhouse-database-via-jdbc-driver | java, scala, apache-spark, jdbc, clickhouse | 1,747,306,375 |
se_60678556 | stackoverflow | DATA_ENGINEERING | How does spark-submit.sh work with different modes and different cluster managers? | How does spark-submit.sh work with different modes and different cluster managers?
In Apache Spark, how does spark-submit.sh work with different modes and different cluster managers? Specifically:
In local deployment mode,
does spark-submit.sh skip calling any cluster manager?
Is it correct that there is no need to ... | https://stackoverflow.com/questions/60678556/how-does-spark-submit-sh-work-with-different-modes-and-different-cluster-manager | apache-spark, cluster-computing | 1,584,144,216 |
se_38746773 | stackoverflow | DATA_ENGINEERING | Read from a hive table and write back to it using spark sql | Read from a hive table and write back to it using spark sql
I am reading a Hive table using Spark SQL and assigning it to a scala val
val x = sqlContext.sql("select * from some_table")
Then I am doing some processing with the dataframe x and finally coming up with a dataframe y , which has the exact schema as the ... | https://stackoverflow.com/questions/38746773/read-from-a-hive-table-and-write-back-to-it-using-spark-sql | scala, apache-spark, hadoop, apache-spark-sql | 1,470,235,282 |
se_79840724 | stackoverflow | DATA_ENGINEERING | Does Databricks Spark SQL evaluate all CASE branches for UDFs? | Does Databricks Spark SQL evaluate all CASE branches for UDFs?
I'm using Databricks SQL and have SQL UDFs for GeoIP / ISP lookups.
Each UDF branches on IPv4 vs IPv6 using a CASE expression like:
CASE
WHEN ip_address LIKE '%:%:%' THEN -- IPv6 path
...
ELSE -- IPv4 path
... | https://stackoverflow.com/questions/79840724/does-databricks-spark-sql-evaluate-all-case-branches-for-udfs | apache-spark, databricks, user-defined-functions | 1,765,181,620 |
se_74728180 | stackoverflow | DATA_ENGINEERING | Union list of pyspark dataframes | Union list of pyspark dataframes
Let's say I have a list of pyspark dataframes: [df1, df2, ...], what I want is to union them (so actually do df1.union(df2).union(df3).... What's the best practice to achieve that? | https://stackoverflow.com/questions/74728180/union-list-of-pyspark-dataframes | apache-spark, pyspark | 1,670,492,180 |
se_79841189 | stackoverflow | DATA_ENGINEERING | Use RSA key snowflake connection options instead of Password | Use RSA key snowflake connection options instead of Password
I want to connect to a Snowflake database from the Data Bricks notebook. I have an RSA key(.pem file) and I don't want to use a traditional method like username and password as it is not as secure as it exposes the password.
pem_file_path = 'rsa_key.pem'
wi... | https://stackoverflow.com/questions/79841189/use-rsa-key-snowflake-connection-options-instead-of-password | apache-spark, snowflake-cloud-data-platform, databricks | 1,765,213,100 |
se_78590050 | stackoverflow | DATA_ENGINEERING | Dataframe write failing in Databricks with error 'ValueError: can not serialize object larger than 2G' | Dataframe write failing in Databricks with error 'ValueError: can not serialize object larger than 2G'
I am trying to process and parse the data from xml file to delta table in azure databricks using python script.
We receive files in xml format and we parse it as structured format using dataframes.
But while ... | https://stackoverflow.com/questions/78590050/dataframe-write-failing-in-databricks-with-error-valueerror-can-not-serialize | python, azure, apache-spark, azure-databricks | 1,717,737,608 |
se_59933649 | stackoverflow | DATA_ENGINEERING | Save a result of printSchema() function to variable in Pyspark? | Save a result of printSchema() function to variable in Pyspark?
I'm using the printSchema function to infer schema of Json file. I want to save the result of this function call in a variable to parse it line by line so that I can extract a structure of a schema and convert it in a DDL schema for creating a table in h... | https://stackoverflow.com/questions/59933649/save-a-result-of-printschema-function-to-variable-in-pyspark | apache-spark, pyspark, ddl | 1,580,137,223 |
se_79839437 | stackoverflow | DATA_ENGINEERING | Warning and performance issues when scanning delta tables | Warning and performance issues when scanning delta tables
Why do I get multiple warnings WARN delta_kernel::engine::default::json] read_json receiver end of channel dropped before sending completed when scanning (pl.scan_delta(temp_path) a delta table that was originally written with spark with
bronze.write.format("d... | https://stackoverflow.com/questions/79839437/warning-and-performance-issues-when-scanning-delta-tables | python, apache-spark, pyspark, python-polars, delta-lake | 1,764,985,516 |
se_79838535 | stackoverflow | DATA_ENGINEERING | How to detect Spark application failure in SparkListener when no jobs are executed? | How to detect Spark application failure in SparkListener when no jobs are executed?
I have a class that extends SparkListener and has access to SparkContext. I'm wondering if there is any way to check in onApplicationEnd whether the Spark application stopped because of an error or exception in the logic, or if the app... | https://stackoverflow.com/questions/79838535/how-to-detect-spark-application-failure-in-sparklistener-when-no-jobs-are-execut | apache-spark | 1,764,908,897 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.