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_79554692 | stackoverflow | DATA_ENGINEERING | How to efficiently divide a big Cassandra table for ETL migration | How to efficiently divide a big Cassandra table for ETL migration
I have a big Cassandra table, which has about 10TB of total size and contains user transactional data.
Table schema is basically 1 primary (partition key) as tx_id and 1 clustering key as tx_time, and other columns.
tx_id: UUID,
tx_time: timestamp,
...(... | https://stackoverflow.com/questions/79554692/how-to-efficiently-divide-a-big-cassandra-table-for-etl-migration | apache-spark, cassandra, etl, data-migration | 1,743,751,285 |
se_79521605 | stackoverflow | DATA_ENGINEERING | Iceberg slow read | Iceberg slow read
We are migrating our data lakehouse from Hive to Iceberg. So, for a while we are producing same data to both Hive and Iceberg.
To compare the performance, I ran the same query on both Hive and Iceberg using Spark 3.5.3.
For Hive-based table, Spark read ~95GB of data, and for Iceberg-based table, it i... | https://stackoverflow.com/questions/79521605/iceberg-slow-read | apache-spark, hive, parquet, apache-iceberg | 1,742,427,942 |
se_79549107 | stackoverflow | DATA_ENGINEERING | Custom Spark JdbcDialect is not used in cluster mode | Custom Spark JdbcDialect is not used in cluster mode
I have a custom JdbcDialect, and I am trying to get it registered in my Spark (v3.5.1) cluster.
The dialect works perfectly fine in a local mode. Additionally, canHandle method implemented to always return true for now. This is how I excluded a DB URL and the dialec... | https://stackoverflow.com/questions/79549107/custom-spark-jdbcdialect-is-not-used-in-cluster-mode | java, apache-spark, apache-spark-sql | 1,743,538,521 |
se_43004849 | stackoverflow | DATA_ENGINEERING | Rename nested field in spark dataframe | Rename nested field in spark dataframe
Having a dataframe df in Spark:
|-- array_field: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- a: string (nullable = true)
| | |-- b: long (nullable = true)
| | |-- c: long (nullable = true)
How to rename field array_fiel... | https://stackoverflow.com/questions/43004849/rename-nested-field-in-spark-dataframe | python, apache-spark, dataframe, pyspark, rename | 1,490,373,678 |
se_46710934 | stackoverflow | DATA_ENGINEERING | pyspark.sql.utils.IllegalArgumentException: u'Field "features" does not exist.' | pyspark.sql.utils.IllegalArgumentException: u'Field "features" does not exist.'
I am trying to execute Random Forest Classifier and evaluate the model using Cross Validation. I work with pySpark. The input CSV file is loaded as Spark DataFrame format.
But I face a issue while constructing the model.
... | https://stackoverflow.com/questions/46710934/pyspark-sql-utils-illegalargumentexception-ufield-features-does-not-exist | apache-spark, pyspark, apache-spark-sql, apache-spark-ml | 1,507,815,014 |
se_79509821 | stackoverflow | DATA_ENGINEERING | Memory increasing monotonically in Spark job | Memory increasing monotonically in Spark job
I need some help with a spark memory issue. I have my Spark application running inside a single JVM as a Kubernetes pod. The nature of the job is that it is a batched job, it runs for 4-5 hours and then the pod is idle. Each batch is processed after the 12-hour gap.
Issue: ... | https://stackoverflow.com/questions/79509821/memory-increasing-monotonically-in-spark-job | java, apache-spark, memory-management, apache-spark-sql, memory-leaks | 1,741,973,082 |
se_79550783 | stackoverflow | DATA_ENGINEERING | spark PySparkValueError error when reading json data with mixed schema versions and then trying to separate the two versions | spark PySparkValueError error when reading json data with mixed schema versions and then trying to separate the two versions
I have a problem around processing mixed-schema JSON data that I read from an S3 bucket using PySpark. I found a solution for my problem in this question, I can specify an explicitly defined sch... | https://stackoverflow.com/questions/79550783/spark-pysparkvalueerror-error-when-reading-json-data-with-mixed-schema-versions | apache-spark, pyspark | 1,743,600,692 |
se_79550675 | stackoverflow | DATA_ENGINEERING | pyspark limit() behaviour different for display and toPandas | pyspark limit() behaviour different for display and toPandas
Given a delta table on databricks where I do a query like:
display(spark.read.table("catalog.schema.my_table_a").filter(col("xyz")=='abc').limit(10))
this takes about 4 seconds.
When I do this transformation to pandas:
spark.read.table("catalog.schema.my_ta... | https://stackoverflow.com/questions/79550675/pyspark-limit-behaviour-different-for-display-and-topandas | pandas, dataframe, apache-spark, pyspark, databricks | 1,743,598,268 |
se_79539223 | stackoverflow | DATA_ENGINEERING | Is it possible to write data from spark executors in java spark? | Is it possible to write data from spark executors in java spark?
I have a java spark application that gets data from kafka, performs some work on said data and then save parquet files to s3 using spark's .write() command. Up until this point my app was saving all received data into spark driver and then would save dat... | https://stackoverflow.com/questions/79539223/is-it-possible-to-write-data-from-spark-executors-in-java-spark | java, scala, apache-spark, parquet | 1,743,086,754 |
se_79500919 | stackoverflow | DATA_ENGINEERING | Spark JDBC Connection To MsSQL Using Kerberos - Failed to find any Kerberos tgt | Spark JDBC Connection To MsSQL Using Kerberos - Failed to find any Kerberos tgt
While trying to connect Spark with MSSQL, we are setting up a JDBC connection and want to Kerberize it. Using the keytab and principal we created, we were able to establish a connection with a simple Java test project. However, when integr... | https://stackoverflow.com/questions/79500919/spark-jdbc-connection-to-mssql-using-kerberos-failed-to-find-any-kerberos-tgt | sql-server, apache-spark, pyspark, jdbc, kerberos | 1,741,699,702 |
se_69741878 | stackoverflow | DATA_ENGINEERING | 'ilike' keyword not working with spark SQL | 'ilike' keyword not working with spark SQL
I am learning apache-spark. And what seems confusing is,
this command works
results = spark.sql("select * from df_sql_view where name LIKE '%i%'")
but this throws an error
results = spark.sql("select * from df_sql_view where name ILIKE '%i%'")
ParseException:
mismatc... | https://stackoverflow.com/questions/69741878/ilike-keyword-not-working-with-spark-sql | apache-spark, pyspark, apache-spark-sql | 1,635,350,293 |
se_79524701 | stackoverflow | DATA_ENGINEERING | Duplicate data at streaming only but not real duplicate exist in the data | Duplicate data at streaming only but not real duplicate exist in the data
I have a delta table and let's call main_table for simplicity. main_table contains N amount of records which have a unique key and it is not duplicate. Let's call unique_id the key.
This delta table is processed by one streaming with the followi... | https://stackoverflow.com/questions/79524701/duplicate-data-at-streaming-only-but-not-real-duplicate-exist-in-the-data | apache-spark, pyspark, databricks, azure-databricks, spark-structured-streaming | 1,742,538,872 |
se_79548123 | stackoverflow | DATA_ENGINEERING | Decide number of buckets on iceberg table | Decide number of buckets on iceberg table
We have iceberg tables on Amazon. We use Amazon Glue with Apache Spark for our ETLs. Is there a way to decide the number of partitions (buckets) on iceberg tables? | https://stackoverflow.com/questions/79548123/decide-number-of-buckets-on-iceberg-table | apache-spark, apache-iceberg | 1,743,497,040 |
se_79539918 | stackoverflow | DATA_ENGINEERING | Modifying Spark Partition Key Without Shuffling | Modifying Spark Partition Key Without Shuffling
I am working in Azure Synapse Analytics, in PySpark. Say I have a PySpark dataframe df with a partition key 'DATE'. However, say that 'DATE' is a string type and we would like to cast it to a date by performing one of the following:
# Option 1
df = df.withColumn('DATE', ... | https://stackoverflow.com/questions/79539918/modifying-spark-partition-key-without-shuffling | azure, apache-spark, pyspark, azure-synapse | 1,743,105,690 |
se_68065826 | stackoverflow | DATA_ENGINEERING | cannot import graphframes dependency in maven project | cannot import graphframes dependency in maven project
I have a maven project and i need import graphframe dependency to use spark grapx,this's my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
... | https://stackoverflow.com/questions/68065826/cannot-import-graphframes-dependency-in-maven-project | java, maven, apache-spark, hadoop, graph | 1,624,269,191 |
se_67211766 | stackoverflow | DATA_ENGINEERING | Efficient way to find columns that contain ANY null values | Efficient way to find columns that contain ANY null values
I want to return a list of all columns that contain at least 1 null value. All of the other similar questions I have seen on StackOverflow are filtering the column where the value is null, but this is definitely sub-optimal since it has to find ALL the null va... | https://stackoverflow.com/questions/67211766/efficient-way-to-find-columns-that-contain-any-null-values | apache-spark, pyspark | 1,619,088,557 |
se_79545497 | stackoverflow | DATA_ENGINEERING | Number of output files created in s3 after Spark Partitioning | Number of output files created in s3 after Spark Partitioning
Recently, during in an interview I faced below question which made me scratching my head and I still don't have the proper answer to it. So please bare with me.
Let's say I a pyspark dataframe having 20 partitions, out of that
only 4 has data in it and 16 a... | https://stackoverflow.com/questions/79545497/number-of-output-files-created-in-s3-after-spark-partitioning | apache-spark, amazon-s3, pyspark, partitioning | 1,743,395,562 |
se_79543952 | stackoverflow | DATA_ENGINEERING | Update the column value if the Id in the dataframe is in the list | Update the column value if the Id in the dataframe is in the list
I am working on a very large dataset that has over 800,000 records and I'm trying to update the column value based on the ID column. If
# Imports
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName('SparkByEx... | https://stackoverflow.com/questions/79543952/update-the-column-value-if-the-id-in-the-dataframe-is-in-the-list | python, dataframe, apache-spark, pyspark, optimization | 1,743,285,896 |
se_79544110 | stackoverflow | DATA_ENGINEERING | Referencing Alias just Created in agg | Referencing Alias just Created in agg
Given this setup:
from pyspark.sql import SparkSession
import pyspark.sql.functions as F
from datetime import datetime
spark = SparkSession.builder.getOrCreate()
data = [
(532, 1234, 5, datetime(2022, 7, 13, 12)),
(824, 1452, 3, datetime(2022, 7, 13, 12)),
(819, 2341... | https://stackoverflow.com/questions/79544110/referencing-alias-just-created-in-agg | python, apache-spark, pyspark | 1,743,299,701 |
se_60748214 | stackoverflow | DATA_ENGINEERING | Does `sbt run`on a project install Scala compiler, interpreter and dependencies locally to the project? | Does `sbt run`on a project install Scala compiler, interpreter and dependencies locally to the project?
If I am correct, Scala is usually installed by sbt for each of your Scala projects rather than being installed system-wide.
I created a simple example:
sbt new scala/hello-world.g8
When I run sbt run on a Scala sbt... | https://stackoverflow.com/questions/60748214/does-sbt-runon-a-project-install-scala-compiler-interpreter-and-dependencies | scala, apache-spark, sbt | 1,584,569,627 |
se_48882723 | stackoverflow | DATA_ENGINEERING | Integrating Spark Structured Streaming with the Confluent Schema Registry | Integrating Spark Structured Streaming with the Confluent Schema Registry
I'm using a Kafka Source in Spark Structured Streaming to receive Confluent encoded Avro records. I intend to use Confluent Schema Registry, but the integration with spark structured streaming seems to be impossible.
I have seen this question,... | https://stackoverflow.com/questions/48882723/integrating-spark-structured-streaming-with-the-confluent-schema-registry | apache-spark, apache-kafka, avro, confluent-schema-registry, spark-structured-streaming | 1,519,121,536 |
se_79544089 | stackoverflow | DATA_ENGINEERING | InaccessibleObjectException when using Spark with Java 21 and Scala 2.11.12 | InaccessibleObjectException when using Spark with Java 21 and Scala 2.11.12
I'm trying to run Apache Spark using Scala 2.11.12 and Java 21.0.6, but I keep running into an error related to accessing internal fields in the java.util.ArrayList class. Specifically, when I try to load a text file using Spark, I get the fol... | https://stackoverflow.com/questions/79544089/inaccessibleobjectexception-when-using-spark-with-java-21-and-scala-2-11-12 | java, apache-spark, mapreduce, bigdata | 1,743,297,157 |
se_79544144 | stackoverflow | DATA_ENGINEERING | After finishing running vacuum on all tables i don't see its freeing up the space | After finishing running vacuum on all tables i don't see its freeing up the space
In Databricks, I ran vacuum on all the tables in loop after successful run, when i check the history for all the tables which contain operation "Vacuum start" and captured "sizeOfDataToDelete" which was closer to 1TB but when check t... | https://stackoverflow.com/questions/79544144/after-finishing-running-vacuum-on-all-tables-i-dont-see-its-freeing-up-the-spac | apache-spark, databricks, azure-databricks | 1,743,304,018 |
se_76308608 | stackoverflow | DATA_ENGINEERING | What could be causing 'Py4JError' when calling 'spark.createDataFrame' on PySpark SQL Session? | What could be causing 'Py4JError' when calling 'spark.createDataFrame' on PySpark SQL Session?
I have installed Apache Spark, Java and Python. I am using a Jupyter notebook. I have an error when creating a dataframe.
I write:
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions im... | https://stackoverflow.com/questions/76308608/what-could-be-causing-py4jerror-when-calling-spark-createdataframe-on-pyspar | apache-spark, pyspark, jupyter-notebook, py4j | 1,684,776,310 |
se_76467988 | stackoverflow | DATA_ENGINEERING | Bigtable from Dataproc: Dependency conflict even after shading the jars | Bigtable from Dataproc: Dependency conflict even after shading the jars
I am trying to run a Spark Application to write and read data to Cloud Bigtable from Dataproc.
Initially, I got this exception java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument. Then came to know that there are some d... | https://stackoverflow.com/questions/76467988/bigtable-from-dataproc-dependency-conflict-even-after-shading-the-jars | java, scala, apache-spark, google-cloud-platform, google-cloud-bigtable | 1,686,682,966 |
se_79538850 | stackoverflow | DATA_ENGINEERING | Spark giving error when writing a limited length Column of type Varbinary for Synapse database | Spark giving error when writing a limited length Column of type Varbinary for Synapse database
I am writing output to a Azure Synapse table where the table contains a varbinary(8000) column. When writing using spark it gives error that UNSUPORTED_DATATYPE as I am trying to limit length from default MAX to 8000 as MAX ... | https://stackoverflow.com/questions/79538850/spark-giving-error-when-writing-a-limited-length-column-of-type-varbinary-for-sy | java, apache-spark, apache-spark-sql, azure-synapse, azure-synapse-analytics | 1,743,078,406 |
se_79396677 | stackoverflow | DATA_ENGINEERING | Providing table options while writing to iceberg table using spark | Providing table options while writing to iceberg table using spark
I am trying to write to a iceberg table(which does not exist before write, hence creating during write) and would like to provide few table properties. Is it possible to do so using the dataframeWriter? I do not want to fire a sql query using spark.sql... | https://stackoverflow.com/questions/79396677/providing-table-options-while-writing-to-iceberg-table-using-spark | apache-spark, pyspark, apache-spark-sql, apache-iceberg | 1,738,152,378 |
se_69814385 | stackoverflow | DATA_ENGINEERING | Exception in thread "main" java.lang.IllegalAccessError: class org.apache.spark.storage.StorageUtils$ | Exception in thread "main" java.lang.IllegalAccessError: class org.apache.spark.storage.StorageUtils$
Hi I try to run spark on my local laptop.
I created a mvn project in intelijidea and in my main class I have one line like bellow and when I try to run a project I got the error like below
val spark = Spark... | https://stackoverflow.com/questions/69814385/exception-in-thread-main-java-lang-illegalaccesserror-class-org-apache-spark | scala, apache-spark, apache-spark-sql, sparkcore | 1,635,872,904 |
se_79539055 | stackoverflow | DATA_ENGINEERING | Sparklyr job hang | Sparklyr job hang
we are running a sparklyr job that runs queries on Cloudera CDP Hive cluster.
The job sometimes stops before a dbWriteTable function, doing nothing and running indefinitely.
The job doesn't always stop in the same point, but always during this trywrite function invocation, not catching any error:
try... | https://stackoverflow.com/questions/79539055/sparklyr-job-hang | r, apache-spark, cloudera, sparklyr | 1,743,082,839 |
se_79538402 | stackoverflow | DATA_ENGINEERING | Appache spark : Cannot grow BufferHolder by size 524432 because the size after growing exceeds size limitation 2147483632 | Appache spark : Cannot grow BufferHolder by size 524432 because the size after growing exceeds size limitation 2147483632
I am working with a large and nested JSON dataset in Apache Spark and encountering a "max buffer size exceeded" exception during the writing process.
My Processing Steps:
Read the JSON file.
Explo... | https://stackoverflow.com/questions/79538402/appache-spark-cannot-grow-bufferholder-by-size-524432-because-the-size-after-g | apache-spark, apache-spark-sql, apache-spark-dataset | 1,743,067,793 |
se_67594518 | stackoverflow | DATA_ENGINEERING | PySpark toPandas faster alternative | PySpark toPandas faster alternative
Is there a faster alternative to convert a PySpark dataframe to a pandas dataframe? I do have "spark.sql.execution.arrow.enabled" set to "true", but it is still taking hours to convert a dataframe. I have also tried writing to parquet from spark and then reading it back in using arr... | https://stackoverflow.com/questions/67594518/pyspark-topandas-faster-alternative | pandas, apache-spark, pyspark, pyarrow | 1,621,375,673 |
se_74563500 | stackoverflow | DATA_ENGINEERING | Spark --archives file not found error, exception from executor | Spark --archives file not found error, exception from executor
I am submitting a Spark job using Dataproc Serverless. My Spark code uses a few .yaml files as configuration and I pass them as --archives to the code.
Command to run the code:
gcloud dataproc batches submit pyspark src/mapper.py \
--project=$PROJECT_ID ... | https://stackoverflow.com/questions/74563500/spark-archives-file-not-found-error-exception-from-executor | apache-spark, pyspark, google-cloud-dataproc | 1,669,305,948 |
se_54058951 | stackoverflow | DATA_ENGINEERING | How to implement Slowly Changing Dimensions (SCD2) Type 2 in Spark using SQL Join | How to implement Slowly Changing Dimensions (SCD2) Type 2 in Spark using SQL Join
We want to implement SCD2 in Spark using SQL Join. i got reference from Github
https://gist.github.com/rampage644/cc4659edd11d9a288c1b
but it's not very clear.
Can anybody provide any example or reference to implement SCD2 in spark
... | https://stackoverflow.com/questions/54058951/how-to-implement-slowly-changing-dimensions-scd2-type-2-in-spark-using-sql-joi | apache-spark, apache-spark-sql | 1,546,753,213 |
se_51070251 | stackoverflow | DATA_ENGINEERING | Pyspark: explode json in column to multiple columns | Pyspark: explode json in column to multiple columns
The data looks like this -
+-----------+-----------+-----------------------------+
| id| point| data|
+-----------------------------------------------------+
| abc| 6|{"key1":"124", "key2": "345"}|
| dfl| ... | https://stackoverflow.com/questions/51070251/pyspark-explode-json-in-column-to-multiple-columns | python, apache-spark, pyspark, apache-spark-sql | 1,530,128,308 |
se_50680499 | stackoverflow | DATA_ENGINEERING | How to sink streaming data from spark to Mongodb? | How to sink streaming data from spark to Mongodb?
I am using pyspark to read streaming data from Kafka and then I want to sink that data to mongodb. I have included all the required packages, but it throws the error that
UnsupportedOperationException: Data source com.mongodb.spark.sql.DefaultSource does not support st... | https://stackoverflow.com/questions/50680499/how-to-sink-streaming-data-from-spark-to-mongodb | mongodb, apache-spark, pyspark | 1,528,114,872 |
se_67591707 | stackoverflow | DATA_ENGINEERING | How do you find out exactly what had caused the high GC time for the spark tasks in any given spark stage? | How do you find out exactly what had caused the high GC time for the spark tasks in any given spark stage?
I do have a spark application where in one of the spark stage took most of the time 2.5hrs + . I did a dive deep and found for majority of the tasks the GC time was pretty high 60% of total task execution time.
T... | https://stackoverflow.com/questions/67591707/how-do-you-find-out-exactly-what-had-caused-the-high-gc-time-for-the-spark-tasks | apache-spark | 1,621,361,040 |
se_50963444 | stackoverflow | DATA_ENGINEERING | Failed to find data source: com.mongodb.spark.sql.DefaultSource | Failed to find data source: com.mongodb.spark.sql.DefaultSource
I'm trying to connect spark (pyspark) to mongodb as follows:
conf = SparkConf()
conf.set('spark.mongodb.input.uri', default_mongo_uri)
conf.set('spark.mongodb.output.uri', default_mongo_uri)
sc = SparkContext(conf=conf)
sqlContext = SQLContext(sc)
spark ... | https://stackoverflow.com/questions/50963444/failed-to-find-data-source-com-mongodb-spark-sql-defaultsource | mongodb, apache-spark, pyspark | 1,529,568,393 |
se_65856580 | stackoverflow | DATA_ENGINEERING | NoSuchMethodError: com.google.common.hash.Hashing.crc32c | NoSuchMethodError: com.google.common.hash.Hashing.crc32c
I'm trying to access Google cloud storage from my spark code. But I'm getting the following error on creating a file in GCS.
java.lang.NoSuchMethodError: com.google.common.hash.Hashing.crc32c()Lcom/google/common/hash/HashFunction;
at com.google.cloud.storage.St... | https://stackoverflow.com/questions/65856580/nosuchmethoderror-com-google-common-hash-hashing-crc32c | scala, apache-spark, google-cloud-storage, guava, spark-submit | 1,611,384,889 |
se_57063120 | stackoverflow | DATA_ENGINEERING | How do I do a flatMap on spark Dataframe rows depending on conditions of multiple field values? | How do I do a flatMap on spark Dataframe rows depending on conditions of multiple field values?
I need to turn an existing map an existing dataframe's rows to multiple rows.
For example depending on if certain fields in a row equal/notequal each other, I need to create x number of rows for that one existing row.
I wa... | https://stackoverflow.com/questions/57063120/how-do-i-do-a-flatmap-on-spark-dataframe-rows-depending-on-conditions-of-multipl | scala, dataframe, apache-spark, flatmap | 1,563,300,433 |
se_79323469 | stackoverflow | DATA_ENGINEERING | Paintully slow Spark Oracle read (JDBC) | Paintully slow Spark Oracle read (JDBC)
I am reading a small table from an Oracle database using Spark on Databricks.
The code is very simple:
df = spark.read.jdbc(url = url, table = table_name, properties = "{"driver": "oracle.jdbc.driver.OracleDriver"})"
df.write.delta.save(delta_location)
The extraction process i... | https://stackoverflow.com/questions/79323469/paintully-slow-spark-oracle-read-jdbc | oracle-database, apache-spark, jdbc | 1,735,814,755 |
se_79525469 | stackoverflow | DATA_ENGINEERING | Understanding checkpoints in Spark Structured Streaming | Understanding checkpoints in Spark Structured Streaming
I have already gone through the basics, working example and the checkpoint directory contents.
Scenario
Say I am reading from a streaming source e.g. Kafka (but not specific to it alone) - I then write it to a CSV. Checkpoints enabled at both read and write strea... | https://stackoverflow.com/questions/79525469/understanding-checkpoints-in-spark-structured-streaming | apache-spark, pyspark, spark-structured-streaming | 1,742,560,854 |
se_79529572 | stackoverflow | DATA_ENGINEERING | "The system cannot find the path specified…..\AppData\Local\Programs\Python\Python313\python.exe] was unexpected at this time" pyspark in command line | "The system cannot find the path specified…..\AppData\Local\Programs\Python\Python313\python.exe] was unexpected at this time" pyspark in command line
I set up spark in my windows system. Post this, I could run pyspark command in command line which worked perfectly 2 days back. But, now surprisingly I get th... | https://stackoverflow.com/questions/79529572/the-system-cannot-find-the-path-specified-appdata-local-programs-python-pyth | python, apache-spark, pyspark | 1,742,758,649 |
se_79522990 | stackoverflow | DATA_ENGINEERING | Spark-submit warns about non-Spark properties from an ini file but works when passed directly | Spark-submit warns about non-Spark properties from an ini file but works when passed directly
I have an ini file that sets some environment-specific properties.
cmds.ini
[DEV]
spark_submit=spark3-submit
[PROD]
spark_submit=spark3-submit
I am parsing this file in shell script and creating spark-submit() function that... | https://stackoverflow.com/questions/79522990/spark-submit-warns-about-non-spark-properties-from-an-ini-file-but-works-when-pa | bash, apache-spark, ini, spark-submit | 1,742,474,979 |
se_69973790 | stackoverflow | DATA_ENGINEERING | Pyspark. spark.SparkException: Job aborted due to stage failure: Task 0 in stage 15.0 failed 1 times, java.net.SocketException: Connection reset | Pyspark. spark.SparkException: Job aborted due to stage failure: Task 0 in stage 15.0 failed 1 times, java.net.SocketException: Connection reset
I'm trying to run multiple time series in Prophet with PySpark (as distributed computing because I have 100s of times series to predict), but I have an error as shown below t... | https://stackoverflow.com/questions/69973790/pyspark-spark-sparkexception-job-aborted-due-to-stage-failure-task-0-in-stage | python, apache-spark, pyspark, apache-spark-sql, prophet | 1,636,976,256 |
se_79526846 | stackoverflow | DATA_ENGINEERING | NullPointerException When Configuring Hadoop to Use JCEKS for Azure Data Lake Storage Authentication | NullPointerException When Configuring Hadoop to Use JCEKS for Azure Data Lake Storage Authentication
I'm integrating Azure Data Lake Storage (ADLS) as a destination in our on-premises application running on Kubernetes. To authenticate, I'm using a Java KeyStore (JCEKS) file containing our Azure Service Principal (SPN)... | https://stackoverflow.com/questions/79526846/nullpointerexception-when-configuring-hadoop-to-use-jceks-for-azure-data-lake-st | apache-spark, kubernetes, hadoop, azure-data-lake, jceks | 1,742,608,937 |
se_79523854 | stackoverflow | DATA_ENGINEERING | Insert overwrite multiple partitions in an external Hive table | Insert overwrite multiple partitions in an external Hive table
I am trying to overwrite multiple partitions in a large table. Basically I have my main external S3 table sandbox, partitioned by part:
scala> q("select * from sandbox")
+---+------------------------------------+----+
|id |val ... | https://stackoverflow.com/questions/79523854/insert-overwrite-multiple-partitions-in-an-external-hive-table | apache-spark, hive, amazon-emr, partition, external-tables | 1,742,496,475 |
se_79526281 | stackoverflow | DATA_ENGINEERING | Exception in thread "main" org.apache.spark.sql.AnalysisException: Column 'timestamp' does not exist. Did you mean one of the following? [timestamp, | Exception in thread "main" org.apache.spark.sql.AnalysisException: Column 'timestamp' does not exist. Did you mean one of the following? [timestamp,
Spark doesn't find one column while njust prints it in the schema:
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apa... | https://stackoverflow.com/questions/79526281/exception-in-thread-main-org-apache-spark-sql-analysisexception-column-times | java, apache-spark | 1,742,580,024 |
se_77565579 | stackoverflow | DATA_ENGINEERING | Spark job stuck at running process | Spark job stuck at running process
I use docker-compose to make a cluster of Spark and Kafka. When I tried to consume a topic by submitting it to this cluster, the job was always stuck and not executed.
Here is my docker-compose file:
version: '3'
services:
spark-master:
image: spark-cluster:1.0
container_na... | https://stackoverflow.com/questions/77565579/spark-job-stuck-at-running-process | python, apache-spark, apache-kafka, docker-compose, apache-zookeeper | 1,701,189,021 |
se_77571194 | stackoverflow | DATA_ENGINEERING | In pyspark, what is the difference between dlt.read_stream() and spark.readstream()? | In pyspark, what is the difference between dlt.read_stream() and spark.readstream()?
I am trying to understand in pyspark, what is the difference between dlt.read_stream() and spark.readstream()? Can we replace dlt.read_stream() with spark.readstream() without affecting the data?
I want to update few PII columns to n... | https://stackoverflow.com/questions/77571194/in-pyspark-what-is-the-difference-between-dlt-read-stream-and-spark-readstrea | apache-spark, pyspark, databricks, spark-streaming, azure-databricks | 1,701,261,211 |
se_61827747 | stackoverflow | DATA_ENGINEERING | How do I pass parameters to spark.sql(""" """)? | How do I pass parameters to spark.sql(""" """)?
I'd like to pass a string to spark.sql
Here is my query
mydf = spark.sql("SELECT * FROM MYTABLE WHERE TIMESTAMP BETWEEN '2020-04-01' AND '2020-04-08')
I'd like to pass a string for the date.
I tried this code
val = '2020-04-08'
s"spa... | https://stackoverflow.com/questions/61827747/how-do-i-pass-parameters-to-spark-sql | apache-spark, pyspark, apache-spark-sql, apache-zeppelin | 1,589,574,140 |
se_79523896 | stackoverflow | DATA_ENGINEERING | Apache Spark operator K8s ingress | Apache Spark operator K8s ingress
Using Apache Spark operator I am attempting to add an nginx ingress to expose the following ports: 8080, 7077, 6066 and 15002
I am attempting to use the following ingress Yaml, which is not correct.
Anyone has a working nginx ingress yaml for Apache Spark master? Thx
apiVersion: netwo... | https://stackoverflow.com/questions/79523896/apache-spark-operator-k8s-ingress | apache-spark, kubernetes | 1,742,498,059 |
se_79433311 | stackoverflow | DATA_ENGINEERING | Spark aggregate on different group of Column | Spark aggregate on different group of Column
I have a table consists of 30 column in which first 5 columns made up to the primary key and rest are information i want to group on with primary keys.
Primary key = year,month,day,hr,ID
rest columns = a,b,c,d,e,f........y
Now I want to calculate count on primary keys with... | https://stackoverflow.com/questions/79433311/spark-aggregate-on-different-group-of-column | scala, apache-spark, aggregate | 1,739,368,302 |
se_79522866 | stackoverflow | DATA_ENGINEERING | CTE query in pyspark with jdbc | CTE query in pyspark with jdbc
I am trying to run a complex query in pyspark using jdbc connection. But I am facing issue with query containing CTE.
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("TestApp").getOrCreate()
jdbc_url=sourceconnectiondetails['url']
prepare_query = f"""WITH Comb... | https://stackoverflow.com/questions/79522866/cte-query-in-pyspark-with-jdbc | sql, apache-spark, pyspark | 1,742,472,248 |
se_57031166 | stackoverflow | DATA_ENGINEERING | Spark - convert JSON array object to array of string | Spark - convert JSON array object to array of string
as part of my dataframe, one of the column has data in following manner
[{"text":"Tea"},{"text":"GoldenGlobes"}]
And I want to convert that as just array of strings.
["Tea", "GoldenGlobes"]
Would someone please let me know, how to do this? | https://stackoverflow.com/questions/57031166/spark-convert-json-array-object-to-array-of-string | apache-spark, dataframe, pyspark, apache-spark-sql | 1,563,138,264 |
se_40287289 | stackoverflow | DATA_ENGINEERING | java.lang.NoClassDefFoundError: org/apache/spark/Logging | java.lang.NoClassDefFoundError: org/apache/spark/Logging
I'm always getting the following error.Can somebody help me please?
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/Logging
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader... | https://stackoverflow.com/questions/40287289/java-lang-noclassdeffounderror-org-apache-spark-logging | java, maven, apache-spark, cassandra, spark-cassandra-connector | 1,477,578,563 |
se_79521858 | stackoverflow | DATA_ENGINEERING | Spark upgrade - java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.sql.catalyst.expressions.VirtualColumn$ | Spark upgrade - java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.sql.catalyst.expressions.VirtualColumn$
after upgrading my application to JDK 17 and Spark to 3.3.1, I encountered the following error:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.sql.catalyst.ex... | https://stackoverflow.com/questions/79521858/spark-upgrade-java-lang-noclassdeffounderror-could-not-initialize-class-org-a | java, apache-spark, debugging, java-17 | 1,742,442,305 |
se_79511083 | stackoverflow | DATA_ENGINEERING | Apache Spark SparkConnectPlugin | Apache Spark SparkConnectPlugin
I am using examples/pi-with-spark-connect-plugin.yaml from Apache Spark operator.
Adding spark.plugins: "org.apache.spark.sql.connect.SparkConnectPlugin" should start the connect server but it not is happening. Any ideas? Thx | https://stackoverflow.com/questions/79511083/apache-spark-sparkconnectplugin | apache-spark | 1,742,039,879 |
se_78816784 | stackoverflow | DATA_ENGINEERING | Reading iceberg table in Dremio fails due to "is not Parquet file" and "expected magic number" | Reading iceberg table in Dremio fails due to "is not Parquet file" and "expected magic number"
I've got a Spark Structured Streaming job that reads data from Kafka and writes them to S3 (NetApp StorageGRID appliance, on-prem) as an Apache Iceberg table (via Nessie catalog).
Afterwards I access the ... | https://stackoverflow.com/questions/78816784/reading-iceberg-table-in-dremio-fails-due-to-is-not-parquet-file-and-expected | apache-spark, spark-streaming, parquet, apache-iceberg, dremio | 1,722,434,372 |
se_79514484 | stackoverflow | DATA_ENGINEERING | Why does Spark raises an IOException while running a aggregation on a streaming dataframe in Dataproc 2.2 | Why does Spark raises an IOException while running a aggregation on a streaming dataframe in Dataproc 2.2
I try to migrate a job that is running on Dataproc 2.1 images (Spark 3.3, Python 3.10) to Dataproc 2.2 images (Spark 3.5, Python 3.11).
However I encounter an error on one of my queries. After further investigatio... | https://stackoverflow.com/questions/79514484/why-does-spark-raises-an-ioexception-while-running-a-aggregation-on-a-streaming | python, apache-spark, pyspark, google-cloud-dataproc | 1,742,212,090 |
se_79516334 | stackoverflow | DATA_ENGINEERING | Spark Java Structured Streaming filters | Spark Java Structured Streaming filters
I have the following data below:
+-------+----------+------------+---------+---------------------+-----------+
|id |resource id|resource name|event-desc|event-date |ipaddress1 |
+-------+----------+------------+---------+---------------------+-----------+
|2010001|119... | https://stackoverflow.com/questions/79516334/spark-java-structured-streaming-filters | java, apache-spark, dataset, spark-structured-streaming | 1,742,273,817 |
se_79515239 | stackoverflow | DATA_ENGINEERING | Performance Degradation with mapInPandas in Spark 3.5.* | Performance Degradation with mapInPandas in Spark 3.5.*
After upgrading to Spark 3.5.*, I noticed a significant performance degradation when using mapInPandas for computationally intensive tasks, in this case computing SHAP values in parallel. Performance remained consistent across Spark versions from 3.1 to 3.4. Howe... | https://stackoverflow.com/questions/79515239/performance-degradation-with-mapinpandas-in-spark-3-5 | apache-spark, pyspark | 1,742,230,358 |
se_34624504 | stackoverflow | DATA_ENGINEERING | Can spark-defaults.conf resolve environment variables? | Can spark-defaults.conf resolve environment variables?
If I have a line like below in my spark-env.sh file
export MY_JARS==$(jars=(/my/lib/dir/*.jar); IFS=,; echo "${jars[*]}")
which gives me a comma delimited list of jars in /my/lib/dir, is there a way I can specify
spark.jars $MY_JARS
in the spark-defaults.con... | https://stackoverflow.com/questions/34624504/can-spark-defaults-conf-resolve-environment-variables | apache-spark | 1,452,045,888 |
se_79515126 | stackoverflow | DATA_ENGINEERING | why this scala code would cause stackoverflow in spark? | why this scala code would cause stackoverflow in spark?
Sometimes when code runs at this function (resultSaver.saveResult) will cause stackoverflow. What's weird is that this error appears by accident without changing any code. I tried serialize some classes or enlarger executor's stack size or set jedisPool as @trans... | https://stackoverflow.com/questions/79515126/why-this-scala-code-would-cause-stackoverflow-in-spark | scala, apache-spark, redis, backend | 1,742,227,930 |
se_72873963 | stackoverflow | DATA_ENGINEERING | Py4JException: Constructor org.apache.spark.sql.SparkSession([class org.apache.spark.SparkContext, class java.util.HashMap]) does not exist | Py4JException: Constructor org.apache.spark.sql.SparkSession([class org.apache.spark.SparkContext, class java.util.HashMap]) does not exist
I am trying to run a spark session in the Jupyter Notebook on a EC2 Linux machine via Visual Studio Code. My code looks as following:
from pyspark.sql import SparkSession
spark = ... | https://stackoverflow.com/questions/72873963/py4jexception-constructor-org-apache-spark-sql-sparksessionclass-org-apache-s | python, apache-spark, pyspark, apache-spark-sql, jupyter-notebook | 1,657,045,506 |
se_79500430 | stackoverflow | DATA_ENGINEERING | How to Exclude Rows Based on a Dynamic Condition in a PySpark Window Function? | How to Exclude Rows Based on a Dynamic Condition in a PySpark Window Function?
I am working with PySpark and need to create a window function that calculates the median of the previous 5 values in a column. However, I want to exclude rows where a specific column feature is True. The challenge is that the value of the ... | https://stackoverflow.com/questions/79500430/how-to-exclude-rows-based-on-a-dynamic-condition-in-a-pyspark-window-function | python, apache-spark, pyspark, apache-spark-sql, window-functions | 1,741,689,262 |
se_79481889 | stackoverflow | DATA_ENGINEERING | spark connect udf fails with "SparkContext or SparkSession should be created first" | spark connect udf fails with "SparkContext or SparkSession should be created first"
I have a Spark Connect server running. Things are fine when I don't use UDFs (df.show() always works fine). But when I use UDF, it fails with SparkContext or SparkSession should be created first. Obviously SparkSession exists... | https://stackoverflow.com/questions/79481889/spark-connect-udf-fails-with-sparkcontext-or-sparksession-should-be-created-fir | apache-spark, pyspark, spark-connect | 1,741,027,695 |
se_79500910 | stackoverflow | DATA_ENGINEERING | How to remove only one column, when there are multiple columns with same in name in dataframe | How to remove only one column, when there are multiple columns with same in name in dataframe
I'm trying to remove one column even though if there multiple columns with same name in Spark dataframe after join operation performed.
df.printSchema()
--- Id String
--- Name String
--- Country String
--- Id String
I wo... | https://stackoverflow.com/questions/79500910/how-to-remove-only-one-column-when-there-are-multiple-columns-with-same-in-name | apache-spark, join, pyspark, duplicates, multiple-columns | 1,741,699,418 |
se_79376561 | stackoverflow | DATA_ENGINEERING | Why Update mode is allowed in stream to static but not in stream to stream join in Spark Streaming | Why Update mode is allowed in stream to static but not in stream to stream join in Spark Streaming
Update mode is allowed when I'm doing a simple stream to static join. But update mode is not allowed when doing stream to stream simple join. I don't understand why Update is allowed in stream to static but not in stream... | https://stackoverflow.com/questions/79376561/why-update-mode-is-allowed-in-stream-to-static-but-not-in-stream-to-stream-join | apache-spark, pyspark, spark-streaming, spark-structured-streaming | 1,737,521,692 |
se_79513404 | stackoverflow | DATA_ENGINEERING | Getting spark.rpc.message.maxSize error with large file | Getting spark.rpc.message.maxSize error with large file
I'm ingesting a large zip file in Azure Databricks (345 gb zip file containing a single 1.5 tb csv with ~3 billion rows). The intention is to convert the csv into a delta table for faster ingestion in a data pipeline. Both are stored in Azure blob storage.
I've i... | https://stackoverflow.com/questions/79513404/getting-spark-rpc-message-maxsize-error-with-large-file | python, azure, apache-spark, databricks, azure-databricks | 1,742,169,442 |
se_79504402 | stackoverflow | DATA_ENGINEERING | PySpark - Convert yearWeek and Day into date | PySpark - Convert yearWeek and Day into date
I have two columns in PySpark dataframe in Databricks:
YearWeek (2417)
Day (0,1,2,3,4,5) - day of a week
Need to create a column with a date.
I was trying to do that in sql(date_add…) and also strptime in Python. SQL returns wrong data and strptime does not work with with... | https://stackoverflow.com/questions/79504402/pyspark-convert-yearweek-and-day-into-date | apache-spark, date, datetime, pyspark, databricks | 1,741,800,082 |
se_72821210 | stackoverflow | DATA_ENGINEERING | How to prevent a sort on a groupby.applyInPandas using hash partitioning on the upstream dataset? | How to prevent a sort on a groupby.applyInPandas using hash partitioning on the upstream dataset?
In my main transform, I'm running an algorithm by doing a groupby and then applyInPandas in Foundry. The build takes very long, and one idea is to organize the files to prevent shuffle reads and sorting, using Hash partit... | https://stackoverflow.com/questions/72821210/how-to-prevent-a-sort-on-a-groupby-applyinpandas-using-hash-partitioning-on-the | apache-spark, pyspark, partitioning, palantir-foundry, foundry-code-repositories | 1,656,618,010 |
se_79508338 | stackoverflow | DATA_ENGINEERING | Prevent --conf in spark-submit from Overriding spark-defaults.conf | Prevent --conf in spark-submit from Overriding spark-defaults.conf
I have built a JAR that captures SQL queries, and I initially intended for customers to add this JAR in spark-defaults.conf. This way, the JAR would be automatically included without requiring any extra configuration on their end.
However, I’ve noticed... | https://stackoverflow.com/questions/79508338/prevent-conf-in-spark-submit-from-overriding-spark-defaults-conf | apache-spark, apache-spark-sql | 1,741,935,551 |
se_79463961 | stackoverflow | DATA_ENGINEERING | How does Spark read unpartitioned Delta tables? | How does Spark read unpartitioned Delta tables?
I observe severe underutilization of CPU in my Databricks job run metrics, on average less than 50% - indicating that I do not parallelize enough tasks in the Spark workflow.
I am especially interested in improving the job's read parallelism. For context, I read multiple... | https://stackoverflow.com/questions/79463961/how-does-spark-read-unpartitioned-delta-tables | apache-spark, pyspark, databricks, azure-databricks, delta-lake | 1,740,408,975 |
se_79510120 | stackoverflow | DATA_ENGINEERING | unix_micros implementation in spark 3.4 scala | unix_micros implementation in spark 3.4 scala
Spark 3.5+ has inbuilt function unix_micros()
which returns the number of microseconds since 1970-01-01 00:00:00 UTC.
I am working on a codebase where I have this use-case but it is using spark 3.4 so this method is not present.
So I wrote my own implementation of this met... | https://stackoverflow.com/questions/79510120/unix-micros-implementation-in-spark-3-4-scala | scala, apache-spark, pyspark | 1,741,982,449 |
se_45977449 | stackoverflow | DATA_ENGINEERING | Convert timestamp to date in Spark dataframe | Convert timestamp to date in Spark dataframe
I've seen (here: How to convert Timestamp to Date format in DataFrame?) the way to convert a timestamp in datetype, but,at least for me, it doesn't work.
Here is what I've tried:
# Create dataframe
df_test = spark.createDataFrame([('20170809',), ('20171007',)], ['date',])
... | https://stackoverflow.com/questions/45977449/convert-timestamp-to-date-in-spark-dataframe | apache-spark, date, pyspark, apache-spark-sql, timestamp | 1,504,170,067 |
se_18316857 | stackoverflow | DATA_ENGINEERING | Maven package works but Intellij's build fails | Maven package works but Intellij's build fails
I have a JDK 1.7 project with a maven dependency to a local jar in my maven repo.
I'm unable to build the project using Intellij, with the errors that a symbol cannot be found (the symbol is a class importing packages from the local jar)
But I can successfully build... | https://stackoverflow.com/questions/18316857/maven-package-works-but-intellijs-build-fails | java, scala, maven, apache-spark, intellij-idea | 1,376,924,008 |
se_68985780 | stackoverflow | DATA_ENGINEERING | ClassNotFoundException even though jar tvf shows the 'missing' class | ClassNotFoundException even though jar tvf shows the 'missing' class
Having a perplexing issue when I run a spark application via a deployed jar (built by maven shade plugin) in non-local environments.
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource
at com... | https://stackoverflow.com/questions/68985780/classnotfoundexception-even-though-jar-tvf-shows-the-missing-class | java, maven, apache-spark, maven-shade-plugin | 1,630,333,622 |
se_79427971 | stackoverflow | DATA_ENGINEERING | two jobs are getting created by only creating a dataframe in databricks note book | two jobs are getting created by only creating a dataframe in databricks note book
I am pretty new to databricks and pyspark. I am creating one dataframe by reading a csv file but i am not calling any action. But I am seeing two jobs are running. Can someone explain why.
from pyspark.sql import SparkSession
from pyspar... | https://stackoverflow.com/questions/79427971/two-jobs-are-getting-created-by-only-creating-a-dataframe-in-databricks-note-boo | apache-spark, pyspark, databricks | 1,739,211,685 |
se_79508980 | stackoverflow | DATA_ENGINEERING | How to do a "roll" in Spark | How to do a "roll" in Spark
I would like to shift the values of a column downwards and have the last element be put on the top. The lag window function almost accomplishes what I want:
df.select($"sample_column", lag("sample_column", 1).over(windowSpec).as("lag")).show()
+-----------------+----+
|sample_col... | https://stackoverflow.com/questions/79508980/how-to-do-a-roll-in-spark | scala, apache-spark | 1,741,952,733 |
se_79507956 | stackoverflow | DATA_ENGINEERING | pyspark --packages spark mongodb connector gives me an error | pyspark --packages spark mongodb connector gives me an error
I'm trying to connect to a mongodb using mongo-spark-connector via pyspark following the guide from the official guide document. https://www.mongodb.com/docs/spark-connector/v10.2/python/api/#python-spark-shell
Whenever I try to execute the below command, th... | https://stackoverflow.com/questions/79507956/pyspark-packages-spark-mongodb-connector-gives-me-an-error | apache-spark, pyspark | 1,741,913,927 |
se_79507329 | stackoverflow | DATA_ENGINEERING | Spark value toDF is not a member of Seq | Spark value toDF is not a member of Seq
I have added this line:
import spark.implicits._
Still getting error:
value toDF is not a member of Seq[(String, String)]
possible cause: maybe a semicolon is missing before ` import spark.implicits._`?
code:
def createNewsPlusArticles(): Dataset[NewsPlusArticle] = {
v... | https://stackoverflow.com/questions/79507329/spark-value-todf-is-not-a-member-of-seq | scala, apache-spark | 1,741,890,925 |
se_79448976 | stackoverflow | DATA_ENGINEERING | NoClassDefFoundError: com/mapr/web/security/SslConfig | NoClassDefFoundError: com/mapr/web/security/SslConfig
I have a java/spark project, and I want to have unitTest.
<spark.version>3.5.2.0</spark.version>
<hive.version>3.1.3.650</hive.version>
<hbase.version>1.4.14.700</hbase.version>
<hadoop.version>3.3.5.500</hadoop.version>
I have crea... | https://stackoverflow.com/questions/79448976/noclassdeffounderror-com-mapr-web-security-sslconfig | java, apache-spark, mapr | 1,739,895,999 |
se_64743322 | stackoverflow | DATA_ENGINEERING | Does "java.io.IOException: Failed to delete Spark temp dir" affect your spark results? | Does "java.io.IOException: Failed to delete Spark temp dir" affect your spark results?
I'm running a spark job using spark-submit. At the end of the day, I'm also getting some output but the log file shows
WARN SparkEnv:87 - Exception while deleting Spark temp dir: ......
java.io.IOException: Failed to delet... | https://stackoverflow.com/questions/64743322/does-java-io-ioexception-failed-to-delete-spark-temp-dir-affect-your-spark-re | apache-spark, pyspark | 1,604,871,648 |
se_79482499 | stackoverflow | DATA_ENGINEERING | Unable to load Trino Spark connector in AWS Glue job | Unable to load Trino Spark connector in AWS Glue job
I'm trying to use the Trino Spark connector in an AWS Glue 4.0 job, but I'm running into issues loading the connector.
Relevant code in my glue job submission script:
trino_drivers_list = list_s3_files(s3_bucket, "bd_cap/trino-drivers/", s3_client)
trino_drivers = "... | https://stackoverflow.com/questions/79482499/unable-to-load-trino-spark-connector-in-aws-glue-job | apache-spark, aws-glue, classnotfoundexception, trino | 1,741,053,004 |
se_69340982 | stackoverflow | DATA_ENGINEERING | What are the differences between Dataframe, Dataset, and RDD in Apache Spark? | What are the differences between Dataframe, Dataset, and RDD in Apache Spark?
In Apache Spark, what are the differences between those API? Why and when should we choose one over the others? | https://stackoverflow.com/questions/69340982/what-are-the-differences-between-dataframe-dataset-and-rdd-in-apache-spark | java, scala, apache-spark, jvm, hdfs | 1,632,714,448 |
se_79491625 | stackoverflow | DATA_ENGINEERING | Apache Spark: Master kills executor after 5 minutes | Apache Spark: Master kills executor after 5 minutes
I have a standalone Spark cluster with a master and one worker (for now). The app runs as an Azure Container App - an app for the master, and another for the worker. Both apps are in the same namespace.
It runs a single application (reads from Kafka, simple transform... | https://stackoverflow.com/questions/79491625/apache-spark-master-kills-executor-after-5-minutes | apache-spark, spark-structured-streaming | 1,741,336,008 |
se_54953953 | stackoverflow | DATA_ENGINEERING | Get value of a particular cell in Spark Dataframe | Get value of a particular cell in Spark Dataframe
I have a Spark dataframe which has 1 row and 3 columns, namely start_date, end_date, end_month_id. I want to retrieve the value from first cell into a variable and use that variable to filter another dataframe.
I want to retrieve '2019-01-01' into a variable. How do I... | https://stackoverflow.com/questions/54953953/get-value-of-a-particular-cell-in-spark-dataframe | apache-spark, dataframe, pyspark, apache-spark-sql | 1,551,485,369 |
se_79497889 | stackoverflow | DATA_ENGINEERING | Spark read csv with semicolon inside cell | Spark read csv with semicolon inside cell
My spark application read csv file with following options:
sparkSession.read
.format("com.databricks.spark.csv")
.option("quote", "\ufffd")
.option("delimiter", ";")
.load("/sample.csv")
I use "\ufffd" as a "quote"-value to avoid problem with data values, when quo... | https://stackoverflow.com/questions/79497889/spark-read-csv-with-semicolon-inside-cell | csv, apache-spark | 1,741,606,977 |
se_79467840 | stackoverflow | DATA_ENGINEERING | pyspark using 'like' threw 'expected char' error | pyspark using 'like' threw 'expected char' error
I have a spark dataframe and when I use the following spark.sql to query, it gives me the error:
'unterminated string literal started at position....Expected char'
df=spark.sql('''
select *
from df
where column_a n... | https://stackoverflow.com/questions/79467840/pyspark-using-like-threw-expected-char-error | dataframe, apache-spark, pyspark | 1,740,516,526 |
se_66721168 | stackoverflow | DATA_ENGINEERING | SparkSessionExtensions injectFunction in Databricks environment | SparkSessionExtensions injectFunction in Databricks environment
SparkSessionExtensions injectFunction works locally, but I can't get it working in the Databricks environment.
The itachi project defines Catalyst expressions, like age that I can successfully use locally via spark-sql:
bin/spark-sql --packages com.github... | https://stackoverflow.com/questions/66721168/sparksessionextensions-injectfunction-in-databricks-environment | apache-spark, apache-spark-sql, databricks, databricks-community-edition | 1,616,240,701 |
se_69054414 | stackoverflow | DATA_ENGINEERING | Why am I getting a FileNotFoundError when trying to create a SparkContext? | Why am I getting a FileNotFoundError when trying to create a SparkContext?
I am currently on Python: 3.7.9, spark: spark-3.1.2-bin-hadoop3.2
In this project venv, I have the settings as:
kafka-python 2.0.2
pip 21.2.4
py4j 0.10.9
pyspark 2.4.6
setuptools 57.4.0
System environment variables:
SPARK_HOME C:\spark... | https://stackoverflow.com/questions/69054414/why-am-i-getting-a-filenotfounderror-when-trying-to-create-a-sparkcontext | python, python-3.x, apache-spark, pyspark | 1,630,750,908 |
se_79430578 | stackoverflow | DATA_ENGINEERING | I'm working using Scala and Spark. How should i get the specific percentage of a specific amount of elements? | I'm working using Scala and Spark. How should i get the specific percentage of a specific amount of elements?
i'm currently working using Scala and org.apache.spark.
I have an RDD where each element inside it is constructed in this way.
(id,subreddit.id,subreddit.name,subreddit.nsfw,created_utc,permalink,domain,ur... | https://stackoverflow.com/questions/79430578/im-working-using-scala-and-spark-how-should-i-get-the-specific-percentage-of-a | scala, apache-spark | 1,739,289,348 |
se_55354987 | stackoverflow | DATA_ENGINEERING | Changing of tmp directory not working in Spark | Changing of tmp directory not working in Spark
I wanted to change the tmp directory used by spark, so I had something like that in my spark-submit.
spark-submit <other parameters> --conf "spark.local.dir=<somedirectory>" <other parameters>
But I am noticing that it has not effect, as Spark still uses the default t... | https://stackoverflow.com/questions/55354987/changing-of-tmp-directory-not-working-in-spark | apache-spark | 1,553,596,418 |
se_79495048 | stackoverflow | DATA_ENGINEERING | Spark groups broadcast hash join in a single task | Spark groups broadcast hash join in a single task
We have a job in spark (databricks) that we are joining ~60 tables.
The job starts by joining the main table with some others tables with SortMergeJoin. This is working fine.
The last step of the query is to join around 20 very small tables and in the execution plan it... | https://stackoverflow.com/questions/79495048/spark-groups-broadcast-hash-join-in-a-single-task | performance, apache-spark, pyspark, apache-spark-sql, databricks | 1,741,468,393 |
se_79437302 | stackoverflow | DATA_ENGINEERING | Spark Crashing in Shared Research Environment | Spark Crashing in Shared Research Environment
Below is the syntax I am running in a Jupyter Notebook on a shared research server. The table I am trying to pull into Pandas is quite large, which is why i have my configuration like this:
I believe the table is 12GB
I have gotten many errors from out of memory (OOM) to h... | https://stackoverflow.com/questions/79437302/spark-crashing-in-shared-research-environment | python, scala, apache-spark, pyspark, apache-spark-sql | 1,739,468,729 |
se_79401266 | stackoverflow | DATA_ENGINEERING | AWS Glue Iceberg "Failed to connect to Hive Metastore" - but I'm not using Hive | AWS Glue Iceberg "Failed to connect to Hive Metastore" - but I'm not using Hive
I'm trying to create an AWS Glue job to test Apache Iceberg. I'm using the default tutorial here. I am getting the error "Failed to connect to Hive Metastore".
Other posts on stackOverflow with this error, they want Hive. I... | https://stackoverflow.com/questions/79401266/aws-glue-iceberg-failed-to-connect-to-hive-metastore-but-im-not-using-hive | amazon-web-services, apache-spark, hive, aws-glue, apache-iceberg | 1,738,272,246 |
se_79491649 | stackoverflow | DATA_ENGINEERING | Can we perform DML and write operations when optimation of delta table is in progress? | Can we perform DML and write operations when optimation of delta table is in progress?
In the documentation, they have mentioned that read operations are allowed during optimize operation, but nothing is mentioned about write and DML operations. If it is possible, can some one provide the link to the documention for s... | https://stackoverflow.com/questions/79491649/can-we-perform-dml-and-write-operations-when-optimation-of-delta-table-is-in-pro | apache-spark, optimization, databricks, delta-lake, delta | 1,741,336,532 |
se_79455329 | stackoverflow | DATA_ENGINEERING | Spark trying to avoid use of collect() | Spark trying to avoid use of collect()
I'm having some troubles trying to improve the performance of a code in Python. This code is reading a huge amount of data (really big) from Databricks.
I filter it doing something like this:
data_filtered = (
data
.filt... | https://stackoverflow.com/questions/79455329/spark-trying-to-avoid-use-of-collect | apache-spark, pyspark, databricks | 1,740,071,655 |
se_79490698 | stackoverflow | DATA_ENGINEERING | Pick a row based on a date or a default | Pick a row based on a date or a default
I have two DataFrames:
df_rates df_trades
(rate from currency -> USD)
+--------+----------+----+ +---+--------+------+----------+
|currency| rate_date|rate| | id|currency|amount|trade_date|
+--------+----------+----+ +---+------... | https://stackoverflow.com/questions/79490698/pick-a-row-based-on-a-date-or-a-default | apache-spark, pyspark | 1,741,295,225 |
se_79481251 | stackoverflow | DATA_ENGINEERING | how concatenate a json key columns using coma as separator | how concatenate a json key columns using coma as separator
i have a problem to resolve this:
Having a json file, like:
{
"database": {
"table_1": {
"load_type": "Delta",
"columns": {
"col_t1_1": "NVARCHAR2",
"col_t1_2": "NUMBER",
"col_... | https://stackoverflow.com/questions/79481251/how-concatenate-a-json-key-columns-using-coma-as-separator | json, dataframe, apache-spark, pyspark, aws-glue | 1,741,012,786 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.