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_58415928
stackoverflow
DATA_ENGINEERING
Spark + s3 - error - java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.s3a.S3AFileSystem not found
Spark + s3 - error - java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.s3a.S3AFileSystem not found I have a spark ec2 cluster where I am submitting a pyspark program from a Zeppelin notebook. I have loaded the hadoop-aws-2.7.3.jar and aws-java-sdk-1.11.179.jar and place them in the /opt/spark/jars director...
https://stackoverflow.com/questions/58415928/spark-s3-error-java-lang-classnotfoundexception-class-org-apache-hadoop-f
apache-spark, amazon-s3, pyspark, apache-zeppelin
1,571,236,726
se_74634671
stackoverflow
DATA_ENGINEERING
How to get the current version of delta table Parquet files
How to get the current version of delta table Parquet files Say I have a table called data and it's some time-series. It's stored like this: /data /date=2022-11-30 /region=usa part-000001.parquet part-000002.parquet Where I have two partition keys and two partitions for the Parquet files. I...
https://stackoverflow.com/questions/74634671/how-to-get-the-current-version-of-delta-table-parquet-files
apache-spark, pyspark, databricks, parquet, delta-lake
1,669,845,747
se_72610005
stackoverflow
DATA_ENGINEERING
Sample random n rows from each group in Pyspark
Sample random n rows from each group in Pyspark I would like to sample at most n rows from each group in the data, where the grouping is defined by a single column. There are many answers for selecting the top n rows, but I dont't need order and am not sure whether ordering would not introduce unnecessary shuffling. I...
https://stackoverflow.com/questions/72610005/sample-random-n-rows-from-each-group-in-pyspark
apache-spark, pyspark
1,655,162,333
se_79835675
stackoverflow
DATA_ENGINEERING
How to dynamically cast columns in a dbt-spark custom materialization to resolve UNION ALL schema mismatch?
How to dynamically cast columns in a dbt-spark custom materialization to resolve UNION ALL schema mismatch? I am working on a custom materialization in dbt using the dbt-spark adapter (writing to Delta tables on S3). The goal is to handle a hybrid SCD Type 1 and Type 2 strategy. The Logic I compare the Source (a tempo...
https://stackoverflow.com/questions/79835675/how-to-dynamically-cast-columns-in-a-dbt-spark-custom-materialization-to-resolve
apache-spark, jinja2, dbt, delta-lake
1,764,667,439
se_79769632
stackoverflow
DATA_ENGINEERING
How to connect to S3 without the large AWS SDK v2 bundle?
How to connect to S3 without the large AWS SDK v2 bundle? I'm trying to read some file from S3 with PySpark 4.0.1 and the S3AFileSystem. The standard configuration using hadoop-aws 3.4.1 works, but it requires the AWS SDK Bundle. This single dependency is over 530 MB, which significantly increases the size of my appli...
https://stackoverflow.com/questions/79769632/how-to-connect-to-s3-without-the-large-aws-sdk-v2-bundle
java, apache-spark, amazon-s3, hadoop
1,758,292,166
se_70746699
stackoverflow
DATA_ENGINEERING
Pyspark Py4JJavaError while creating the delta-table
Pyspark Py4JJavaError while creating the delta-table Here is the pyspark code which is running on jupyter notebook. import pyspark from delta import * builder = pyspark.sql.SparkSession.builder.appName("MyApp") \ .config("spark.sql.extensions", "io.delta.sql.DeltaSparkSessionExtension") \ .config(...
https://stackoverflow.com/questions/70746699/pyspark-py4jjavaerror-while-creating-the-delta-table
python, apache-spark, pyspark, jupyter-notebook, delta-lake
1,642,448,512
se_72862898
stackoverflow
DATA_ENGINEERING
Round df.describe() results
Round df.describe() results Is there any way to set decimals in the describe() function? I want the result to only show 2 decimals.
https://stackoverflow.com/questions/72862898/round-df-describe-results
python, apache-spark, pyspark, apache-spark-sql, google-colaboratory
1,656,979,642
se_79697293
stackoverflow
DATA_ENGINEERING
How to fail Spark on wrong schema?
How to fail Spark on wrong schema? The data: {"name": "name1", "id": 1} {"name": "name2", "id": "1"} The code: val schema = """ | name STRING, | id BIGINT |""".stripMargin spark.read.schema(schema).json("my_path").show Output: +-----+----+ | name| id| +-----+----+ |name1| 1| |name2|null| +----...
https://stackoverflow.com/questions/79697293/how-to-fail-spark-on-wrong-schema
scala, apache-spark
1,752,161,421
se_66080996
stackoverflow
DATA_ENGINEERING
Pyspark, PandasUDF; How to return a matrix using Pyspark.PandasUDF?
Pyspark, PandasUDF; How to return a matrix using Pyspark.PandasUDF? I would like to implement a pandasUDF function in PySpark that returns a matrix of float numbers. I have tried, but the below appeared. RuntimeError: ('Exception thrown when converting pandas.Series (float64) to Arrow Array (list<item: float>). It ca...
https://stackoverflow.com/questions/66080996/pyspark-pandasudf-how-to-return-a-matrix-using-pyspark-pandasudf
python, apache-spark, pyspark, apache-spark-sql
1,612,639,545
se_79830428
stackoverflow
DATA_ENGINEERING
Handle corrupted files in spark load()
Handle corrupted files in spark load() I have a spark job that runs daily to load data from S3. These data are composed of thousands of gzip files. However, in some cases, there is one or two corrupted files in S3, and it causes the whole spark_reader.load() task to fail. An error occurred while calling o112.load. inc...
https://stackoverflow.com/questions/79830428/handle-corrupted-files-in-spark-load
apache-spark, amazon-s3, pyspark
1,764,141,445
se_79830770
stackoverflow
DATA_ENGINEERING
How log model in mlflow using Spark Connect
How log model in mlflow using Spark Connect I have the following setup: Kubernetes cluster with Spark Connect 4.0.1 and MLflow tracking server 3.5.0 MLFlow tracking server should serve all artifacts and is configured this way: --backend-store-uri=postgresql:// --artifacts-destination=<s3 bucket> --serve-artifacts I...
https://stackoverflow.com/questions/79830770/how-log-model-in-mlflow-using-spark-connect
apache-spark, pyspark, mlflow, spark-connect
1,764,164,372
se_38610559
stackoverflow
DATA_ENGINEERING
Convert spark DataFrame column to python list
Convert spark DataFrame column to python list I work on a dataframe with two column, mvv and count. +---+-----+ |mvv|count| +---+-----+ | 1 | 5 | | 2 | 9 | | 3 | 3 | | 4 | 1 | i would like to obtain two list containing mvv values and count value. Something like mvv = [1,2,3,4] count = [5,9,3,1] So, I tri...
https://stackoverflow.com/questions/38610559/convert-spark-dataframe-column-to-python-list
python, apache-spark, pyspark, apache-spark-sql
1,469,615,778
se_34598914
stackoverflow
DATA_ENGINEERING
How to let Spark output print on separate new lines?
How to let Spark output print on separate new lines? Currently my spark console prints like this, which is not very readable: I want it to print each StructField item on a new line, so that it's easier to read. What should I do? Thanks. Update: I'm actually following this tutorial (http://www.nodalpoint.com/spark...
https://stackoverflow.com/questions/34598914/how-to-let-spark-output-print-on-separate-new-lines
apache-spark, pyspark, apache-spark-sql
1,451,937,777
se_68346389
stackoverflow
DATA_ENGINEERING
Why planInputPartitions is called multiple times in a micro-batch?
Why planInputPartitions is called multiple times in a micro-batch? I'm developing a new Spark connector using data source v2 API (spark 3.1.1). I noticed that the planInputPartitions method (in MicroBatchStream) is called twice every micro-batch. What the motivation/reason is?
https://stackoverflow.com/questions/68346389/why-planinputpartitions-is-called-multiple-times-in-a-micro-batch
apache-spark, datasource
1,626,088,452
se_79828213
stackoverflow
DATA_ENGINEERING
PicklingError: Could not serialize object: RecursionError in pyspark code in Jupyter Notebook
PicklingError: Could not serialize object: RecursionError in pyspark code in Jupyter Notebook I am very new in Spark (specifically, have just started with learning), and I have encountered a recursion error in a very simple code. Background: Spark Version 3.5.7 Java Version 11.0.29 (Eclipse Adoptium) Python 3.14 ...
https://stackoverflow.com/questions/79828213/picklingerror-could-not-serialize-object-recursionerror-in-pyspark-code-in-jup
python, apache-spark, pyspark
1,763,948,835
se_48673247
stackoverflow
DATA_ENGINEERING
Comparing schema of dataframe using Pyspark
Comparing schema of dataframe using Pyspark I have a data frame (df). For showing its schema I use: from pyspark.sql.functions import * df1.printSchema() And I get the following result: #root # |-- name: string (nullable = true) # |-- age: long (nullable = true) Sometimes the schema changes (the column type or n...
https://stackoverflow.com/questions/48673247/comparing-schema-of-dataframe-using-pyspark
python, apache-spark, pyspark, apache-spark-sql
1,518,037,597
se_78701979
stackoverflow
DATA_ENGINEERING
Casting RDD to a different type (from float64 to double)
Casting RDD to a different type (from float64 to double) I have a code like below, which uses pyspark. test_truth_value = RDD. test_predictor_rdd = RDD. valuesAndPred = test_truth_value.zip(lasso_model.predict(test_predictor_rdd)).map(lambda x: ((x[0]), (x[1]))) metrics = RegressionMetrics(valuesAndPred) When i run t...
https://stackoverflow.com/questions/78701979/casting-rdd-to-a-different-type-from-float64-to-double
python, apache-spark, pyspark, types, rdd
1,720,008,571
se_79826762
stackoverflow
DATA_ENGINEERING
Large variation in spark runtimes
Large variation in spark runtimes Long story short, my team was hired to take on some legacy code and it was running around 5ish hours. We began making some minor changes that shouldn't have affected the runtimes in any significant way, but slowly over the last month we have seen run times go from 5 hours to 20 hours....
https://stackoverflow.com/questions/79826762/large-variation-in-spark-runtimes
apache-spark, runtime
1,763,743,349
se_79819692
stackoverflow
DATA_ENGINEERING
Pushing down filters in RDBMS with Java Spark
Pushing down filters in RDBMS with Java Spark I have been working as a Data Engineer and got this issue. I came across a use case where I have a view(lets name it as inputView) which is created by reading data from some source. Now somewhere later in the pipeline I have to again read data from RDBMS ,create a view(tra...
https://stackoverflow.com/questions/79819692/pushing-down-filters-in-rdbms-with-java-spark
java, apache-spark, apache-spark-sql, bigdata, data-engineering
1,763,100,806
se_79016199
stackoverflow
DATA_ENGINEERING
Hadoop Installation, Error: getSubject is supported only if a security manager is allowed
Hadoop Installation, Error: getSubject is supported only if a security manager is allowed I tried to install Hadoop on my macOS Ventura but has been failed several times. I tried download the lower versions of hadoop as well but no luck so far. Tried Hadoop Versions: 3.4.0 and 3.3.6 Java Version: java 23 Error Message...
https://stackoverflow.com/questions/79016199/hadoop-installation-error-getsubject-is-supported-only-if-a-security-manager-i
apache-spark, hadoop, hadoop-yarn
1,727,123,003
se_79812135
stackoverflow
DATA_ENGINEERING
Pyspark- Multithreading in Python
Pyspark- Multithreading in Python I have a user case like this. I have a list of many queries. I am running multi-threading with pyspark with each thread submitting some sql. There are some queries that report success but the final table has no data. Spark-ui has some tasks in stage that report OOM, but in the end it ...
https://stackoverflow.com/questions/79812135/pyspark-multithreading-in-python
multithreading, apache-spark, pyspark
1,762,507,024
se_67924823
stackoverflow
DATA_ENGINEERING
Issue loading data set using spark-redis
Issue loading data set using spark-redis I am trying to load a data set with spark-redis, but the operation always fail. The spark dataframe that I am trying to write has 85 million rows, but the write operation roughly fails after 25 million rows in. I wonder how to solve this kind of problem. Here are the operations...
https://stackoverflow.com/questions/67924823/issue-loading-data-set-using-spark-redis
apache-spark, pyspark, redis, apache-spark-sql
1,623,341,278
se_66582053
stackoverflow
DATA_ENGINEERING
How to use LIKE operator as a JOIN condition in pyspark as a column
How to use LIKE operator as a JOIN condition in pyspark as a column I would like to do the following in pyspark (for AWS Glue jobs): JOIN a and b ON a.name = b.name AND a.number= b.number AND a.city LIKE b.city So for example: Table a: Number Name City 1000 Bob % 2000 Joe London Table b: Number Name...
https://stackoverflow.com/questions/66582053/how-to-use-like-operator-as-a-join-condition-in-pyspark-as-a-column
python, apache-spark, pyspark, apache-spark-sql, aws-glue
1,615,463,649
se_79818852
stackoverflow
DATA_ENGINEERING
Databricks always loads built-in BigQuery connector (0.22.2), can’t override with 0.43.x
Databricks always loads built-in BigQuery connector (0.22.2), can’t override with 0.43.x I am using Databricks Runtime 15.4 (Spark 3.5 / Scala 2.12) on AWS. My goal is to use the latest Google BigQuery connector because I need the direct write method (BigQuery Storage Write API): option("writeMethod", "direct") This ...
https://stackoverflow.com/questions/79818852/databricks-always-loads-built-in-bigquery-connector-0-22-2-can-t-override-wit
apache-spark, google-bigquery, databricks, aws-databricks, spark-bigquery-connector
1,763,036,664
se_67832795
stackoverflow
DATA_ENGINEERING
Why does AWS EMR EC2 instances have default spark.yarn.executor.memoryOverhead set to 18.75%
Why does AWS EMR EC2 instances have default spark.yarn.executor.memoryOverhead set to 18.75% Amazon EMR default memory limits for Spark executors With the Spark on YARN configuration option which was introduced in EMR version 5.22: spark.yarn.executor.memoryOverheadFactor and defaults to 0.1875 (18.75% of the spark.ya...
https://stackoverflow.com/questions/67832795/why-does-aws-emr-ec2-instances-have-default-spark-yarn-executor-memoryoverhead-s
amazon-web-services, apache-spark, hadoop-yarn, amazon-emr
1,622,790,162
se_59761596
stackoverflow
DATA_ENGINEERING
Is there a way to query AWS Athena with PySpark from Jupyter Notebook?
Is there a way to query AWS Athena with PySpark from Jupyter Notebook? I am able to query SQL database without any problem except for Athena AWS. There seems to not be any connection string that works for it. I tried to follow spark Athena connector but it requires AWS Glue. I want to be able to query Athena AWS from ...
https://stackoverflow.com/questions/59761596/is-there-a-way-to-query-aws-athena-with-pyspark-from-jupyter-notebook
python, amazon-web-services, apache-spark, jupyter-notebook
1,579,135,785
se_79818071
stackoverflow
DATA_ENGINEERING
PySpark 3.5.5 CharType in read.csv schema definition
PySpark 3.5.5 CharType in read.csv schema definition I'm using a PySpark notebook inside of Azure Synapse. This is my schema definition qcew_schema = StructType([ StructField( 'area_fips', dataType = CharType(5), nullable = False), #TODO convert to StringIndexer(of IntegerType, ...
https://stackoverflow.com/questions/79818071/pyspark-3-5-5-chartype-in-read-csv-schema-definition
apache-spark, pyspark, azure-synapse
1,762,969,821
se_63505589
stackoverflow
DATA_ENGINEERING
Hadoop input with 100k paths cause extremely long time during splits
Hadoop input with 100k paths cause extremely long time during splits I am using Flink batch API with Hadoop FileInputFormat to process a large number of input files(approx. 100k). I found it is extremely slow for job to be prepared. I found that in FileInputFormat.getSplits() method, it iterate all input paths and get...
https://stackoverflow.com/questions/63505589/hadoop-input-with-100k-paths-cause-extremely-long-time-during-splits
apache-spark, hadoop, apache-flink
1,597,928,092
se_43728505
stackoverflow
DATA_ENGINEERING
in spark streaming must i call count() after cache() or persist() to force caching/persistence to really happen?
in spark streaming must i call count() after cache() or persist() to force caching/persistence to really happen? watching this very good video on spark internals the presenter says that unless one performs an action on ones RDD after caching it caching will not really happen. I never see count() being called in any ...
https://stackoverflow.com/questions/43728505/in-spark-streaming-must-i-call-count-after-cache-or-persist-to-force-cachi
caching, apache-spark, rdd
1,493,686,259
se_70985235
stackoverflow
DATA_ENGINEERING
What is openCostInBytes?
What is openCostInBytes? Can someone explain me openCostInBytes in Apache Spark? I can see definition in documentation but I dont understand how exactly it can affect reading files. Should I really care about this and if yes how should I tune it?
https://stackoverflow.com/questions/70985235/what-is-opencostinbytes
apache-spark, apache-spark-sql, databricks
1,643,972,268
se_60822248
stackoverflow
DATA_ENGINEERING
Merge json column names with case in-sensitive
Merge json column names with case in-sensitive My JSON column names are a combination of lower and uppercase case (Ex: title/Title and name/Name), due to which in output, I am getting name and Name as two different columns (similarly title and Title). How can I make the JSON columns as case insensitive? config("spark....
https://stackoverflow.com/questions/60822248/merge-json-column-names-with-case-in-sensitive
json, scala, apache-spark, apache-spark-sql
1,585,001,605
se_79812859
stackoverflow
DATA_ENGINEERING
col function error type mismatch: found string required Int
col function error type mismatch: found string required Int I am attempting to programmatically remove specific columns/fields from a dataframe (anything that starts with _), whether the field is in the root or in a struct, using the dropFields method. For example, if I had "foo._baz", the syntax would be: df.withCol...
https://stackoverflow.com/questions/79812859/col-function-error-type-mismatch-found-string-required-int
scala, apache-spark
1,762,556,760
se_79815625
stackoverflow
DATA_ENGINEERING
PySpark/MongoDB Connector DataException: dataType &#39;struct&#39; is invalid for &#39;BsonArray&#39; during ETL
PySpark/MongoDB Connector DataException: dataType &#39;struct&#39; is invalid for &#39;BsonArray&#39; during ETL I am running a data ingestion ETL pipeline orchestrated by Airflow using PySpark to read data from MongoDB (using the MongoDB Spark Connector) and load it into a Delta Lake table. The pipeline is failing du...
https://stackoverflow.com/questions/79815625/pyspark-mongodb-connector-dataexception-datatype-struct-is-invalid-for-bsona
mongodb, apache-spark, pyspark
1,762,779,752
se_62613729
stackoverflow
DATA_ENGINEERING
Maximum number of concurrent tasks in 1 DPU in AWS Glue
Maximum number of concurrent tasks in 1 DPU in AWS Glue A standard DPU in AWS Glue comes with 4 vCPU and 2 executors. I am confused about the maximum number of concurrent tasks that can be run in parallel with this configuration. Is it 4 or 8 on a single DPU with 4vcpu and 2 executors?
https://stackoverflow.com/questions/62613729/maximum-number-of-concurrent-tasks-in-1-dpu-in-aws-glue
amazon-web-services, apache-spark, apache-spark-sql, aws-glue
1,593,281,109
se_79810356
stackoverflow
DATA_ENGINEERING
Spark 4.0.1 MongoDB Connector 10.5.0: Missing configuration for: collection and NoClassDefFoundError: com.mongodb.client.MongoClient
Spark 4.0.1 MongoDB Connector 10.5.0: Missing configuration for: collection and NoClassDefFoundError: com.mongodb.client.MongoClient I am trying to read data from MongoDB in Spark 4.0.1 using the MongoDB Spark Connector (version 10.5.0). My PySpark code looks like this: from pyspark.sql import SparkSession spark = Sp...
https://stackoverflow.com/questions/79810356/spark-4-0-1-mongodb-connector-10-5-0-missing-configuration-for-collection-and
mongodb, apache-spark, pyspark
1,762,361,019
se_79809124
stackoverflow
DATA_ENGINEERING
Does BucketBy clause while writing Pyspark dataframe shuflle the data
Does BucketBy clause while writing Pyspark dataframe shuflle the data I am writing a pyspark dataframe as table in my Spark warehouse. I am bucketing it on specific column using bucketBy clause and assigning 10 buckets. I have read on several blog posts that bucketBy shuffle the data across partitions and assign key b...
https://stackoverflow.com/questions/79809124/does-bucketby-clause-while-writing-pyspark-dataframe-shuflle-the-data
python, apache-spark, pyspark
1,762,271,980
se_36435403
stackoverflow
DATA_ENGINEERING
How to set partition for Window function for PySpark?
How to set partition for Window function for PySpark? I'm running a PySpark job, and I'm getting the following message: WARN org.apache.spark.sql.execution.Window: No Partition Defined for Window operation! Moving all data to a single partition, this can cause serious performance degradation. What does the message ...
https://stackoverflow.com/questions/36435403/how-to-set-partition-for-window-function-for-pyspark
apache-spark, pyspark, apache-spark-sql, google-cloud-dataproc
1,459,884,574
se_79809216
stackoverflow
DATA_ENGINEERING
How to do bucket logic in partition for Iceberg Table using AWS Glue?
How to do bucket logic in partition for Iceberg Table using AWS Glue? # ===================================================== # 🧊 Step 4. Write Data to Iceberg Table (Glue Catalog) # ===================================================== table_name = "glue_catalog.cmt_test_db.iceberg_table" ( df.writeTo(table_na...
https://stackoverflow.com/questions/79809216/how-to-do-bucket-logic-in-partition-for-iceberg-table-using-aws-glue
apache-spark, pyspark, aws-glue, apache-iceberg, pyiceberg
1,762,277,720
se_53649039
stackoverflow
DATA_ENGINEERING
Renaming spark output csv in azure blob storage
Renaming spark output csv in azure blob storage I have a Databricks notebook setup that works as the following; pyspark connection details to Blob storage account Read file through spark dataframe convert to pandas Df data modelling on pandas Df convert to spark Df write to blob storage in single file My problem i...
https://stackoverflow.com/questions/53649039/renaming-spark-output-csv-in-azure-blob-storage
python, azure, apache-spark, pyspark, azure-storage
1,544,091,314
se_79794432
stackoverflow
DATA_ENGINEERING
dataproc serverless slow consume kafka topic
dataproc serverless slow consume kafka topic I use dataproc serverless with java API to read kafka topic. The topic has only 2 partitions. The topic receives 200 msg/sec. After reading messages I repartition to 100, transform the data then write to BQ. Since I repartition I see two stages one with 2 tasks to read data...
https://stackoverflow.com/questions/79794432/dataproc-serverless-slow-consume-kafka-topic
java, apache-spark, spark-structured-streaming, dataproc
1,760,898,609
se_79808013
stackoverflow
DATA_ENGINEERING
How to reference a CSV column with parentheses and a decimal point in Spark SQL or COALESCE expression?
How to reference a CSV column with parentheses and a decimal point in Spark SQL or COALESCE expression? I’m working on a data ingestion pipeline using Apache Spark (triggered via a Cloud Function on Dataproc). The input CSV contains column names that include special characters such as parentheses and a decimal point f...
https://stackoverflow.com/questions/79808013/how-to-reference-a-csv-column-with-parentheses-and-a-decimal-point-in-spark-sql
scala, apache-spark, google-bigquery
1,762,183,178
se_72709396
stackoverflow
DATA_ENGINEERING
java.io.IOException in local spark mode
java.io.IOException in local spark mode I am a newer in spark. Thanks for your attention and your help. Here is my problem. I started my spark-shell(version 3.2.1) in local mode in my mac os (Catalina 10.15.7), then I ran some code below, no exceptions happened import org.apache.spark.sql.types.{StringType, IntegerTyp...
https://stackoverflow.com/questions/72709396/java-io-ioexception-in-local-spark-mode
apache-spark
1,655,869,046
se_33742895
stackoverflow
DATA_ENGINEERING
How to show full column content in a Spark Dataframe?
How to show full column content in a Spark Dataframe? I am using spark-csv to load data into a DataFrame. I want to do a simple query and display the content: val df = sqlContext.read.format("com.databricks.spark.csv").option("header", "true").load("my.csv") df.registerTempTable("tasks") results = sqlContext.sql("sel...
https://stackoverflow.com/questions/33742895/how-to-show-full-column-content-in-a-spark-dataframe
dataframe, scala, apache-spark, spark-csv, output-formatting
1,447,701,464
se_76528498
stackoverflow
DATA_ENGINEERING
Advice on how to use GraphX (use-case in the description below)
Advice on how to use GraphX (use-case in the description below) I have a dataset where each row has three features <src, dest, traceID>. The row represents a single edge (from source to destination) and the ID of the trace it belongs to. Note that these traces are invocation of microservices collected from an observab...
https://stackoverflow.com/questions/76528498/advice-on-how-to-use-graphx-use-case-in-the-description-below
scala, apache-spark, spark-graphx
1,687,405,790
se_58730826
stackoverflow
DATA_ENGINEERING
Why spark count action has executed in three stages
Why spark count action has executed in three stages I have loaded a csv file. Re-partitioned it to 4 and then took count of the DataFrame. And when I looked at the DAG I see this action is executed in 3 stages. Why this simple action is executed into 3 stages. I suppose 1st stage is to load the file and 2nd is to ...
https://stackoverflow.com/questions/58730826/why-spark-count-action-has-executed-in-three-stages
apache-spark, apache-spark-sql
1,573,045,333
se_76219575
stackoverflow
DATA_ENGINEERING
how to create dataframe from json input file in spark?
how to create dataframe from json input file in spark? I am creating dataframe from downloaded json file which results in error that some of data is corrupted. I used spark.read.json("json file path") to create dataframe. Error is: pyspark.sql.utils.AnalysisException: Since Spark 2.3, the queries from raw JSON/CSV fil...
https://stackoverflow.com/questions/76219575/how-to-create-dataframe-from-json-input-file-in-spark
python, apache-spark, pyspark
1,683,728,565
se_79805303
stackoverflow
DATA_ENGINEERING
fairscheduler.xml on the classpath
fairscheduler.xml on the classpath Spark documentation says that for scheduler allocation file we can: put a file named fairscheduler.xml on the classpath I have included fairscheduler.xml in the root of the jar file that I use with spark-submit but pool scheduler is not used. Does anyone where to place fairscheduler....
https://stackoverflow.com/questions/79805303/fairscheduler-xml-on-the-classpath
apache-spark
1,761,866,797
se_79804646
stackoverflow
DATA_ENGINEERING
Loading a large multiline CSV file using pyspark is extremely slow
Loading a large multiline CSV file using pyspark is extremely slow I've got a multiline CSV file which is about 150GB and I've been trying to load it using the usual code e.g. df = spark.read.format('csv').option('header', True).option('multiLine', True).load('path/to/csv/file') This works fine for small files, but fo...
https://stackoverflow.com/questions/79804646/loading-a-large-multiline-csv-file-using-pyspark-is-extremely-slow
csv, apache-spark, pyspark, multiline
1,761,820,037
se_79483932
stackoverflow
DATA_ENGINEERING
Delta Lake Merge Rewrites unchanged files
Delta Lake Merge Rewrites unchanged files I want to do a merge on a subset of my delta table partitions to do incremental upserts to keep two tables in sync. I do not use a whenNotMatchedBySource statement to clean up stale rows in my target because of this GitHub Issue. Because of that I am just focussing on update a...
https://stackoverflow.com/questions/79483932/delta-lake-merge-rewrites-unchanged-files
apache-spark, pyspark, merge, delta-lake, transaction-log
1,741,097,269
se_42803595
stackoverflow
DATA_ENGINEERING
How to write data in the dataframe into single .parquet file(both data &amp; metadata in single file) in HDFS?
How to write data in the dataframe into single .parquet file(both data &amp; metadata in single file) in HDFS? How to write data in the dataframe into single .parquet file(both data & metadata in single file) in HDFS? df.show() --> 2 rows +------+--------------+----------------+ | name|favorite_color|favorite_numbers...
https://stackoverflow.com/questions/42803595/how-to-write-data-in-the-dataframe-into-single-parquet-fileboth-data-metadat
apache-spark, pyspark, apache-spark-sql, biginsights
1,489,563,373
se_77831832
stackoverflow
DATA_ENGINEERING
Docker configuration with official Airflow and Spark
Docker configuration with official Airflow and Spark I'm currently building a set of big data tools in Docker. I'm using Ubuntu 22 locally. Python in its latest version, Apache Spark 3.5.0 and Airflow 2.7.3. I'm having trouble configuring Spark with Airflow. I've read a lot here on this topic and have been looking for...
https://stackoverflow.com/questions/77831832/docker-configuration-with-official-airflow-and-spark
docker, apache-spark, docker-compose, airflow
1,705,488,553
se_79785550
stackoverflow
DATA_ENGINEERING
Spark 3.3.1: decimal(38,10) shows as 0E-10 in DataFrame and inserts as NULL into Hive (Parquet / insertInto)
Spark 3.3.1: decimal(38,10) shows as 0E-10 in DataFrame and inserts as NULL into Hive (Parquet / insertInto) Environment: Apache Spark: 3.3.1 Hive: 3.1.3 (metastore + Hive server) Table storage format: PARQUET Insertion method: dataframe.format("hive").insertInto("db.table") Problem col_REG with Hive type decimal(38,...
https://stackoverflow.com/questions/79785550/spark-3-3-1-decimal38-10-shows-as-0e-10-in-dataframe-and-inserts-as-null-into
apache-spark, hive
1,759,932,753
se_79799582
stackoverflow
DATA_ENGINEERING
How to Check if a Query Touches Data Files or just Uses Manifests and Metadata in Iceberg
How to Check if a Query Touches Data Files or just Uses Manifests and Metadata in Iceberg I created a table as follows: CREATE TABLE IF NOT EXISTS raw_data.civ ( date timestamp, marketplace_id int, ... some more columns ) USING ICEBERG PARTITIONED BY ( marketplace_id, days(date) ) TBLPROPERTIES ( ...
https://stackoverflow.com/questions/79799582/how-to-check-if-a-query-touches-data-files-or-just-uses-manifests-and-metadata-i
apache-spark, apache-spark-sql, amazon-athena, apache-iceberg
1,761,405,109
se_79796949
stackoverflow
DATA_ENGINEERING
How to collect multiple metrics with observe in PySpark without triggering multiple actions
How to collect multiple metrics with observe in PySpark without triggering multiple actions I have a PySpark job that reads data from table a, performs some transformations and filters, and then writes the result to table b. Here’s a simplified version of the code: import pyspark.sql.functions as F spark = ... # in...
https://stackoverflow.com/questions/79796949/how-to-collect-multiple-metrics-with-observe-in-pyspark-without-triggering-multi
python, apache-spark, pyspark, apache-spark-sql
1,761,146,225
se_78232933
stackoverflow
DATA_ENGINEERING
Is the &quot;new&quot; .isEmpty() function an action or transformation?
Is the &quot;new&quot; .isEmpty() function an action or transformation? The isEmpty() pyspark function (https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.DataFrame.isEmpty.html) added in Spark 3.3.0 is an action? I am asking this because, in the documentation page shared above, in t...
https://stackoverflow.com/questions/78232933/is-the-new-isempty-function-an-action-or-transformation
apache-spark, pyspark
1,711,554,251
se_38350249
stackoverflow
DATA_ENGINEERING
SparkContext Error - File not found /tmp/spark-events does not exist
SparkContext Error - File not found /tmp/spark-events does not exist Running a Python Spark Application via API call - On submitting the Application - response - Failed SSH into the Worker My python application exists in /root/spark/work/driver-id/wordcount.py Error can be found in /root/spark/work/driver-id/s...
https://stackoverflow.com/questions/38350249/sparkcontext-error-file-not-found-tmp-spark-events-does-not-exist
python, amazon-web-services, apache-spark, amazon-ec2, pyspark
1,468,408,804
se_66211977
stackoverflow
DATA_ENGINEERING
Spark streaming socket stream example not working
Spark streaming socket stream example not working I'm trying to use Spark Streaming, but I'm stuck at the first example: import java.util.Arrays; import org.apache.spark.*; import org.apache.spark.api.java.function.*; import org.apache.spark.streaming.*; import org.apache.spark.streaming.api.java.*; import scala.Tupl...
https://stackoverflow.com/questions/66211977/spark-streaming-socket-stream-example-not-working
scala, apache-spark, spark-streaming, netcat
1,613,407,353
se_79793883
stackoverflow
DATA_ENGINEERING
Apache Spark TransformWithState operator not working as expected
Apache Spark TransformWithState operator not working as expected Hi I'm trying to implement a stateprocessor for my custom logic., ideally we are streaming and I want the custom logic of calculating packet loss from a previous row. i implemented the stateprocessor but it is not working as expected. the first microbat...
https://stackoverflow.com/questions/79793883/apache-spark-transformwithstate-operator-not-working-as-expected
apache-spark, pyspark, foreach, azure-databricks, spark-structured-streaming
1,760,808,277
se_79793069
stackoverflow
DATA_ENGINEERING
Databricks Community Edition: spark.conf.get(&#39;spark.sql.adaptiveExecution.enabled&#39;) not available on serverless compute
Databricks Community Edition: spark.conf.get(&#39;spark.sql.adaptiveExecution.enabled&#39;) not available on serverless compute I’m using Databricks Community Edition (Free tier) with Spark 4.0.0. I noticed that the UI no longer allows creating a standard cluster — only the serverless compute option is available. I tr...
https://stackoverflow.com/questions/79793069/databricks-community-edition-spark-conf-getspark-sql-adaptiveexecution-enable
apache-spark, pyspark, databricks, azure-databricks
1,760,705,674
se_78241781
stackoverflow
DATA_ENGINEERING
PySpark performance chained transformations vs successive reassignment
PySpark performance chained transformations vs successive reassignment I'm somewhat new to PySpark. I understand that it uses lazy evaluation, meaning that execution of a series of transformations will be deferred until some action is requested, at which point the Spark engine optimizes the entire set of transformati...
https://stackoverflow.com/questions/78241781/pyspark-performance-chained-transformations-vs-successive-reassignment
apache-spark, pyspark, apache-spark-sql
1,711,681,447
se_56983526
stackoverflow
DATA_ENGINEERING
Error while using dataframe show method in pyspark
Error while using dataframe show method in pyspark I am trying to read data from BigQuery using pandas and pyspark. I am able to get the data but somehow getting below error while converting it into Spark DataFrame. py4j.protocol.Py4JJavaError: An error occurred while calling o28.showString. : java.lang.IllegalStateE...
https://stackoverflow.com/questions/56983526/error-while-using-dataframe-show-method-in-pyspark
python-3.x, apache-spark, pyspark, google-bigquery
1,562,829,103
se_79775129
stackoverflow
DATA_ENGINEERING
Running a notebook through Spark Connect fails to operate with Kafka
Running a notebook through Spark Connect fails to operate with Kafka I have created this Docker Compose file: # Command: docker stack deploy streaming-stack --compose-file docker/spark-kstreams-stack.yml # Gary A. Stafford (2022-09-14) # Updated: 2022-12-28 version: "3.9" services: spark-master: image: "apache...
https://stackoverflow.com/questions/79775129/running-a-notebook-through-spark-connect-fails-to-operate-with-kafka
apache-spark, pyspark, apache-kafka
1,758,820,697
se_30611875
stackoverflow
DATA_ENGINEERING
Regex in Apache Spark
Regex in Apache Spark I have a text file that reads like this:- This recipe can be made either with a stand mixer, or by hand with a bowl, a wooden spoon, and strong arms. If you use salted butter, please omit the added salt in this recipe. Yum Ingredients 1 1/4 cups all-purpose flour (160 g) 1/4 teaspoon salt 1/2 t...
https://stackoverflow.com/questions/30611875/regex-in-apache-spark
regex, scala, apache-spark
1,433,310,881
se_72917589
stackoverflow
DATA_ENGINEERING
Scala - Apply a function to each value in a dataframe column
Scala - Apply a function to each value in a dataframe column I have a function that takes a LocalDate (it could take any other type) and returns a DataFrame, e.g.: def genDataFrame(refDate: LocalDate): DataFrame = { Seq( (refDate,refDate.minusDays(7)), (refDate.plusDays(3),refDate.plusDays(7)) ).toDF("col_...
https://stackoverflow.com/questions/72917589/scala-apply-a-function-to-each-value-in-a-dataframe-column
dataframe, scala, apache-spark
1,657,319,289
se_79791629
stackoverflow
DATA_ENGINEERING
Constantly getting a connection reset error when connecting to ClickHouse from Spark
Constantly getting a connection reset error when connecting to ClickHouse from Spark Following the Spark Native Connector in ClickHouse, I downloaded clickhouse-spark-runtime-3.5.2_0.8.0 and clickhouse-jdbc-all-0.9.2, and set the catalog configured to: The correct username and password and host name Ssl mode as true P...
https://stackoverflow.com/questions/79791629/constantly-getting-a-connection-reset-error-when-connecting-to-clickhouse-from-s
apache-spark, clickhouse, clickhouse-client
1,760,564,576
se_33527226
stackoverflow
DATA_ENGINEERING
PySpark Yarn Application fails on groupBy
PySpark Yarn Application fails on groupBy I'm trying to run a job on Yarn mode that processes a large amount of data (2TB) read from Google cloud storage. The pipeline can be summarized like this: sc.textFile("gs://path/*.json")\ .map(lambda row: json.loads(row))\ .map(toKvPair)\ .groupByKey().take(10) [...] later p...
https://stackoverflow.com/questions/33527226/pyspark-yarn-application-fails-on-groupby
apache-spark, pyspark, google-cloud-dataproc
1,446,655,142
se_79777361
stackoverflow
DATA_ENGINEERING
Python worker exited unexpectedly due to connection reset in pyspark
Python worker exited unexpectedly due to connection reset in pyspark I'm trying to run PySpark code, but I'm having problems with it. versions: OS: windows 11 apache spark: 4.0.1 java: 17.0.12 2024-07-16 LTS python version: 3.11.9 hadoop: 3.3.6 Code: from pyspark.sql import SparkSession import os os.environ["PYARRO...
https://stackoverflow.com/questions/79777361/python-worker-exited-unexpectedly-due-to-connection-reset-in-pyspark
python, apache-spark, pyspark, windows-11
1,759,067,527
se_73998338
stackoverflow
DATA_ENGINEERING
Spark Databricks fraction cached is dropping after an action (Scala)
Spark Databricks fraction cached is dropping after an action (Scala) I use persist command to cache a dataframe on MEMORY_AND_DISK and have been observing a weird pattern. A persisted dataframe is cached to 100% when that specific job (Job 6, in the below screenshot) which does the necessary transformations is complet...
https://stackoverflow.com/questions/73998338/spark-databricks-fraction-cached-is-dropping-after-an-action-scala
scala, apache-spark, caching, databricks, persist
1,665,243,713
se_33570326
stackoverflow
DATA_ENGINEERING
SubtractByKey and keep rejected values
SubtractByKey and keep rejected values I was playing around with spark and I am getting stuck with something that seems foolish. Let's say we have two RDD: rdd1 = {(1, 2), (3, 4), (3, 6)} rdd2 = {(3, 9)} if I am doing rdd1.substrackByKey(rdd2) , I will get {(1, 2)} which is perfectly fine. But I also want to save the ...
https://stackoverflow.com/questions/33570326/subtractbykey-and-keep-rejected-values
scala, apache-spark
1,446,824,265
se_79784816
stackoverflow
DATA_ENGINEERING
Scala spark: Why does DataFrame.transform calling a transform hang?
Scala spark: Why does DataFrame.transform calling a transform hang? I have a job on scala (v. 2.12.15) spark (v. 3.5.1) that works correctly and looks something like this: import org.apache.spark.sql.DataFrame ... val myDataFrame = myReadDataFunction(...) .transform(myTransformer) ... It previously looked l...
https://stackoverflow.com/questions/79784816/scala-spark-why-does-dataframe-transform-calling-a-transform-hang
dataframe, scala, apache-spark, apache-spark-sql
1,759,860,446
se_79514059
stackoverflow
DATA_ENGINEERING
Can an optimize operation on a delta table be resumed?
Can an optimize operation on a delta table be resumed? If an already running optimize operation is interrupted and if we start the optimize operation again, would it resume from where it was interrupted or will it start over? I did not find any thing about this in official documentation.
https://stackoverflow.com/questions/79514059/can-an-optimize-operation-on-a-delta-table-be-resumed
apache-spark, optimization, delta-lake, delta
1,742,201,654
se_79780717
stackoverflow
DATA_ENGINEERING
DataprocSparkSession package in python error - &quot;RuntimeError: Error while creating Dataproc Session&quot;
DataprocSparkSession package in python error - &quot;RuntimeError: Error while creating Dataproc Session&quot; I am using below code to create Dataproc Spark Session to run a job from google.cloud.dataproc_spark_connect import DataprocSparkSession from google.cloud.dataproc_v1 import Session session = Session() sess...
https://stackoverflow.com/questions/79780717/dataprocsparksession-package-in-python-error-runtimeerror-error-while-creati
apache-spark, google-cloud-platform, bigdata, google-cloud-dataproc
1,759,392,436
se_79782906
stackoverflow
DATA_ENGINEERING
Spark3 writes are slower than spark2
Spark3 writes are slower than spark2 Spark3 vs spark2: I have three spark dataframes util, dept, cntry. All three are created by reading three different hive tables with some where clause. All three have customer_id as common column. I combine them into one dataframe by having a for loop to iterate through these dataf...
https://stackoverflow.com/questions/79782906/spark3-writes-are-slower-than-spark2
apache-spark, pyspark
1,759,658,359
se_79763243
stackoverflow
DATA_ENGINEERING
manage Z-Order with Predictive Optimization in databricks
manage Z-Order with Predictive Optimization in databricks I want to understand how to manage Z-Order in Databricks when using Predictive Optimization (PO). According to the documentation: "OPTIMIZE does not run ZORDER when executed with predictive optimization. On tables that use Z-order, predictive optimization will ...
https://stackoverflow.com/questions/79763243/manage-z-order-with-predictive-optimization-in-databricks
azure, apache-spark, optimization, databricks, azure-databricks
1,757,700,715
se_79781081
stackoverflow
DATA_ENGINEERING
Error when reading .csv.gz files in databricks
Error when reading .csv.gz files in databricks I have a small files with.csv.gz compressed format in gcs bucket and have mounted it and created external volumes on top of it in databricks(unity catalog enabled). So when I try to read a file with just 100 KB size its throwing below error. [FAILED_READ_FILE.NO_HINT] Er...
https://stackoverflow.com/questions/79781081/error-when-reading-csv-gz-files-in-databricks
apache-spark, pyspark, azure-databricks
1,759,419,223
se_63233906
stackoverflow
DATA_ENGINEERING
Unable to start spark-shell failing to submit spark-submit
Unable to start spark-shell failing to submit spark-submit I am trying to submit spark-submit but its failing with as weird message. Error: Could not find or load main class org.apache.spark.launcher.Main /opt/spark/bin/spark-class: line 96: CMD: bad array subscript this is the first time I am seeing this kind of e...
https://stackoverflow.com/questions/63233906/unable-to-start-spark-shell-failing-to-submit-spark-submit
apache-spark, apache-spark-sql, spark-streaming
1,596,474,432
se_79781392
stackoverflow
DATA_ENGINEERING
Spatial join without Apache Sedona
Spatial join without Apache Sedona currently I'm working in a specific version of Apache Spark (3.1.1) that cannot upgrade. Since that I can't use Apache Sedona and the version 1.3.1 is too slow. My problem is the following code that works for standalone pure python but in cluster mode returns Null for all data. I sus...
https://stackoverflow.com/questions/79781392/spatial-join-without-apache-sedona
apache-spark, kubernetes, apache-spark-sql, geospatial
1,759,455,349
se_76087409
stackoverflow
DATA_ENGINEERING
InheritedThreadLocal not working inside spark
InheritedThreadLocal not working inside spark I have a project where different kinds of jobs are run in spark for this we convert the data into sparks dataframe and are applying foreach lambda on those dataframes to make them execute parallely. Now for a job I need to store some variables at the start of the job and m...
https://stackoverflow.com/questions/76087409/inheritedthreadlocal-not-working-inside-spark
apache-spark, rdd, java-threads, thread-local
1,682,286,104
se_79712951
stackoverflow
DATA_ENGINEERING
Reduce number of created snapshot with kafka streaming realtime
Reduce number of created snapshot with kafka streaming realtime My system runs realtime data stream from kafka to hdfs integrated with iceberg using spark, how to reduce the number of snapshots created each time insert while still maintaining realtime capability (without increasing the number of records per batch in s...
https://stackoverflow.com/questions/79712951/reduce-number-of-created-snapshot-with-kafka-streaming-realtime
apache-spark, apache-kafka, apache-iceberg
1,753,343,102
se_79725944
stackoverflow
DATA_ENGINEERING
Cannot expire snapshot with retain last properies
Cannot expire snapshot with retain last properies I have 67 snapshot in a single table but when i use CALL iceberg_catalog.system.expire_snapshots( table => 'iceberg_catalog.default.test_7', retain_last => 5 ); It doesn't delete any snapshot. My table use 2 properties which is : write.metadata.delete-after-commit.ena...
https://stackoverflow.com/questions/79725944/cannot-expire-snapshot-with-retain-last-properies
apache-spark, hadoop, apache-iceberg
1,754,388,387
se_79779965
stackoverflow
DATA_ENGINEERING
EMR Spark Job Fails to Connect to MSK with IAM Auth - Timeout Waiting for Node Assignment Error
EMR Spark Job Fails to Connect to MSK with IAM Auth - Timeout Waiting for Node Assignment Error I am running an Apache Spark job on Amazon EMR that needs to connect to an Amazon MSK cluster configured with IAM authentication. The EMR cluster has an IAM role with full MSK permissions, and I can successfully access MSK ...
https://stackoverflow.com/questions/79779965/emr-spark-job-fails-to-connect-to-msk-with-iam-auth-timeout-waiting-for-node-a
apache-spark, amazon-iam, amazon-emr, aws-msk, spark-kafka-integration
1,759,317,633
se_68173118
stackoverflow
DATA_ENGINEERING
spark-redis exception: Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
spark-redis exception: Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out I am trying to insert data to redis (Azure Cache for Redis) through spark. There are around 700 million rows and I am using spark-redis connector to insert data. It fails after som...
https://stackoverflow.com/questions/68173118/spark-redis-exception-caused-by-redis-clients-jedis-exceptions-jedisconnection
apache-spark, redis, spark-redis
1,624,944,876
se_52840897
stackoverflow
DATA_ENGINEERING
Efficient joins in spark dataframe
Efficient joins in spark dataframe I am trying to join a DataFrame (dfA) sequentially on the same DataFrame. Let's say dfA has columns id_x and id_y and dfB has the column id and some other columns. I want to do perform the following: dfA.join(dfB, dfA("id_x") === dfB("id")).join(dfB, dfA("id_y") === dfB("id")) Is...
https://stackoverflow.com/questions/52840897/efficient-joins-in-spark-dataframe
scala, apache-spark, join, apache-spark-sql, distributed-computing
1,539,710,615
se_32435263
stackoverflow
DATA_ENGINEERING
DataFrame join optimization - Broadcast Hash Join
DataFrame join optimization - Broadcast Hash Join I am trying to effectively join two DataFrames, one of which is large and the second is a bit smaller. Is there a way to avoid all this shuffling? I cannot set autoBroadCastJoinThreshold, because it supports only Integers - and the table I am trying to broadcast is ...
https://stackoverflow.com/questions/32435263/dataframe-join-optimization-broadcast-hash-join
dataframe, apache-spark, pyspark, apache-spark-sql, apache-spark-1.4
1,441,617,988
se_79393798
stackoverflow
DATA_ENGINEERING
How to create pyspark docker image?
How to create pyspark docker image? When i go through the docker images uploaded for pyspark from docker hub, I see that the last upload was done almost 2 years ago. https://hub.docker.com/r/apache/spark-py/tags I want to create a new image based on the new spark versions which have come up in the past 2 years. I went...
https://stackoverflow.com/questions/79393798/how-to-create-pyspark-docker-image
docker, apache-spark, pyspark, dockerfile
1,738,067,065
se_79778783
stackoverflow
DATA_ENGINEERING
How can i change my Spark session in Databricks Community Edition?
How can i change my Spark session in Databricks Community Edition? I want to change my spark session from 'pyspark.sql.connect.dataframe.DataFrame' to 'pyspark.sql.dataframe.DataFrame' so that I can run StringIndexer and VectorAssembler. If I run it in pyspark.sql.connect.dataframe.DataFrame, I'm getting an Assertion ...
https://stackoverflow.com/questions/79778783/how-can-i-change-my-spark-session-in-databricks-community-edition
apache-spark, pyspark, databricks, databricks-community-edition
1,759,214,804
se_79778217
stackoverflow
DATA_ENGINEERING
Pyspark error py4j.protocol.Py4JJavaError
Pyspark error py4j.protocol.Py4JJavaError I keep running into this issue when running PySpark. I was able to connect to my database and retrieve data, but whenever I try do operations like .show() or .count(), or when I try to save a Spark DataFrame to a CSV, it keeps crashing with the following error traceback. (Note...
https://stackoverflow.com/questions/79778217/pyspark-error-py4j-protocol-py4jjavaerror
apache-spark, hadoop, pyspark
1,759,155,099
se_52606350
stackoverflow
DATA_ENGINEERING
Cannot load local file into PySpark Dataframe
Cannot load local file into PySpark Dataframe I am a MacOS user and I just downloaded Apache Spark. I then put it in /usr/local/spark. Here is what inside my .bash_profile: export SPARK_HOME="/usr/local/spark" export PYSPARK_PYTHON=python3 export PATH=$PATH:$SPARK_HOME/bin #export PYSPARK_DRIVER_PYTHON="jupyter" #exp...
https://stackoverflow.com/questions/52606350/cannot-load-local-file-into-pyspark-dataframe
apache-spark, pyspark, local-files
1,538,475,407
se_79775898
stackoverflow
DATA_ENGINEERING
Pushdown on spark datasource v2 implementation
Pushdown on spark datasource v2 implementation I have a datasource v2 implementation where we have implemented interfaces for supporting filter pushdown, limit pushdown, top n pushdown, aggregates pushdown , filter pushdown and column pruning.. Now we want to explore on pushdown function to the datasource. For example...
https://stackoverflow.com/questions/79775898/pushdown-on-spark-datasource-v2-implementation
apache-spark
1,758,887,962
se_79774255
stackoverflow
DATA_ENGINEERING
pyspark on Windows - unexpected termination during collect()
pyspark on Windows - unexpected termination during collect() I am new to python and pyspark. I'm trying to run it on Windows Server 2022. I have environment variables HADOOP_HOME=C:\spark\hadoop JAVA_HOME=C:\Program Files\Microsoft\jdk-17.0.16.8-hotspot SPARK_HOME=C:\spark\spark-4.0.1-bin-hadoop3 PYSPARK_PYTHON=C:\P...
https://stackoverflow.com/questions/79774255/pyspark-on-windows-unexpected-termination-during-collect
python, apache-spark, pyspark, windows-server
1,758,756,480
se_26443796
stackoverflow
DATA_ENGINEERING
How to aggregate data in Apache Spark
How to aggregate data in Apache Spark I have a distributed system on 3 nodes and my data is distributed among those nodes. For example, I have a test.csv file which exists on all 3 nodes, and it contains 4 columns of row | id, C1, C2, C3 ---------------------- row1 | A1 , c1 , c2 ,2 row2 | A1 , c1 , c2 ,1 row3...
https://stackoverflow.com/questions/26443796/how-to-aggregate-data-in-apache-spark
apache-spark, apache-spark-sql, pyspark
1,413,661,337
se_77489033
stackoverflow
DATA_ENGINEERING
.display() not giving any result in Databricks
.display() not giving any result in Databricks I have been using data bricks for quite some time now. recently i got a new Databricks environment and i also mounted azure ADLS gen 2 to my Databricks env. i tested the connection it looks good . but when i read any file from mount point , the code is just running and no...
https://stackoverflow.com/questions/77489033/display-not-giving-any-result-in-databricks
apache-spark, pyspark, databricks
1,700,062,544
se_79610495
stackoverflow
DATA_ENGINEERING
Spark memory error in thread spark-listener-group-eventLog
Spark memory error in thread spark-listener-group-eventLog I have a pyspark application which is using Graphframes to compute connected components on a DataFrame. The edges DataFrame I generate has 2.7M records. When I run the code it is slow, but slowly works through the required transformations and joins prior to th...
https://stackoverflow.com/questions/79610495/spark-memory-error-in-thread-spark-listener-group-eventlog
python, apache-spark, pyspark, google-cloud-dataproc, graphframes
1,746,620,188
se_48443115
stackoverflow
DATA_ENGINEERING
UnsupportedOperationException When Inserting into Map
UnsupportedOperationException When Inserting into Map I am using the Spark's collectAsMap function [Spark CollectAsMap to obtain a Map. In this map, when I do the put operation I am getting the following exception: ERROR ApplicationMaster: User class threw exception: java.lang.UnsupportedOperationException java.lang....
https://stackoverflow.com/questions/48443115/unsupportedoperationexception-when-inserting-into-map
java, apache-spark, collections, hashmap
1,516,883,971
se_79773743
stackoverflow
DATA_ENGINEERING
What connector can be used for Google Cloud pubsub along with Cloud dataproc ( Spark 3.5.x )
What connector can be used for Google Cloud pubsub along with Cloud dataproc ( Spark 3.5.x ) I am using Spark 3.5.x and would like to use readStream() API to read structured streaming using Java . I don't see any pubsub connector available. Couldn't try pubsub lite because it is deprecated now Note: Pub/Sub Lite is d...
https://stackoverflow.com/questions/79773743/what-connector-can-be-used-for-google-cloud-pubsub-along-with-cloud-dataproc-s
apache-spark, google-cloud-platform, google-cloud-pubsub, google-cloud-dataproc
1,758,719,258
se_36119594
stackoverflow
DATA_ENGINEERING
Duplicating the partition key onto a clustering key
Duplicating the partition key onto a clustering key Not sure if the question's title sounds crazy but I thought about this and I'd like to check the "validity" of the pro's and con's I imagine. The ideal C* query in "production" targets only one partition, possibly with additional restrictions on the clustering keys....
https://stackoverflow.com/questions/36119594/duplicating-the-partition-key-onto-a-clustering-key
apache-spark, cassandra, apache-spark-sql
1,458,507,908
se_66437011
stackoverflow
DATA_ENGINEERING
Trying to read file from s3 with FLINK using the IDE getting Class org.apache.hadoop.fs.s3a.S3AFileSystem not found
Trying to read file from s3 with FLINK using the IDE getting Class org.apache.hadoop.fs.s3a.S3AFileSystem not found I am trying to read a file from s3 using Flink from IntelliJ and getting the following exception: Caused by: java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.s3a.S3AFileSystem not found Thi...
https://stackoverflow.com/questions/66437011/trying-to-read-file-from-s3-with-flink-using-the-ide-getting-class-org-apache-ha
scala, apache-spark, amazon-s3, apache-flink, flink-streaming
1,614,678,637
se_53149457
stackoverflow
DATA_ENGINEERING
java.lang.UnsupportedOperationException: Error in spark when writing
java.lang.UnsupportedOperationException: Error in spark when writing When I try to write the dataset into parquet files, I get below error 18/11/05 06:25:43 ERROR FileFormatWriter: Aborting job null. org.apache.spark.SparkException: Job aborted due to stage failure: Task 84 in stage 1.0 failed 4 times, most recent fa...
https://stackoverflow.com/questions/53149457/java-lang-unsupportedoperationexception-error-in-spark-when-writing
apache-spark, apache-spark-dataset
1,541,399,824
se_79762155
stackoverflow
DATA_ENGINEERING
Changes to Delta Table Reflect in Existing Spark Dataframe
Changes to Delta Table Reflect in Existing Spark Dataframe Platform: Azure Databricks Compute: Serverless I create a Spark data frame by selecting a subset of records from a delta table. I perform several transformations on the data set. Each transformation results in a new data frame. Before the transformation, I had...
https://stackoverflow.com/questions/79762155/changes-to-delta-table-reflect-in-existing-spark-dataframe
apache-spark, databricks
1,757,606,501
se_38745685
stackoverflow
DATA_ENGINEERING
spark sql query to delete with join conditions
spark sql query to delete with join conditions I'm trying to delete a table values checking with another table, like DELETE Table1 FROM Table1 t1 INNER JOIN Table2 t2 ON t1.Col1 = t2.Col1 WHERE t2.Col3 IN ('Two-Three','Two-Four') It is not working as I get the above error Exception in thread "main": java.lang.R...
https://stackoverflow.com/questions/38745685/spark-sql-query-to-delete-with-join-conditions
sql, apache-spark
1,470,232,539