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_36939337 | stackoverflow | DATA_ENGINEERING | spark dataframe and design Hbase : one table multiple-columns vs multiple tables one column family | spark dataframe and design Hbase : one table multiple-columns vs multiple tables one column family
I have multiples tables on an oracle database. I would like to copy these tables on Hbase, what is the best design, one table with multiple-columns family and each column family represent an oracle table? or multiple tab... | https://stackoverflow.com/questions/36939337/spark-dataframe-and-design-hbase-one-table-multiple-columns-vs-multiple-tables | oracle-database, apache-spark, dataframe, apache-spark-sql, hbase | 1,461,935,661 |
se_79586540 | stackoverflow | DATA_ENGINEERING | Apache Spark left join python databricks | Apache Spark left join python databricks
I have three dataframes in databricks and try to run a join on them (apache spark functions). I mainly was used to pandas dataframe join. My current code is:
joined_df = df_1.join(df_2, df_1["RECONTRACT"] == df_2["RECONTRACT"], "left")
joined_df = joined_df.join(df_3, joined_df... | https://stackoverflow.com/questions/79586540/apache-spark-left-join-python-databricks | python, apache-spark, databricks | 1,745,326,850 |
se_79613985 | stackoverflow | DATA_ENGINEERING | Disable Databricks-generated error messages | Disable Databricks-generated error messages
Since Databricks Runtime 12.2 Databricks started to wrap spark exceptions in their own exceptions.
https://learn.microsoft.com/en-us/azure/databricks/error-messages/
While for some users it might be handy, for our team it is not convenient, as we cannot see original exceptio... | https://stackoverflow.com/questions/79613985/disable-databricks-generated-error-messages | apache-spark, databricks, azure-databricks | 1,746,788,144 |
se_79598279 | stackoverflow | DATA_ENGINEERING | Reading Databrick Delta Tables from HDInsight | Reading Databrick Delta Tables from HDInsight
I would like to read delta tables generated by Databricks on an HDInsight Spark cluster. When trying to do that, I run into this error:
org.apache.spark.sql.delta.actions.InvalidProtocolVersionException: Delta protocol version is too new for this version of the Databricks ... | https://stackoverflow.com/questions/79598279/reading-databrick-delta-tables-from-hdinsight | apache-spark, databricks, azure-hdinsight | 1,745,926,850 |
se_39111918 | stackoverflow | DATA_ENGINEERING | Can I read a CSV represented as a string into Apache Spark using spark-csv? | Can I read a CSV represented as a string into Apache Spark using spark-csv?
I know how to read a CSV file into Apache Spark using spark-csv, but I already have the CSV file represented as a string and would like to convert this string directly to dataframe. Is this possible? | https://stackoverflow.com/questions/39111918/can-i-read-a-csv-represented-as-a-string-into-apache-spark-using-spark-csv | apache-spark, pyspark, apache-spark-sql, spark-csv | 1,471,992,794 |
se_79610989 | stackoverflow | DATA_ENGINEERING | Inconsistent value from month_between() function of spark scala | Inconsistent value from month_between() function of spark scala
When I am calculating value of months difference between 2026-03-08 and 2025-02-24 using months_between() function in spark-scala, it is giving 12.48387097 value (12 months 15 days).
But if we calculate the days difference then it is 377 days (12 months 1... | https://stackoverflow.com/questions/79610989/inconsistent-value-from-month-between-function-of-spark-scala | scala, apache-spark | 1,746,634,130 |
se_79613107 | stackoverflow | DATA_ENGINEERING | PySpark UDF mapping is returning empty columns | PySpark UDF mapping is returning empty columns
Given a dataframe, I want to apply a mapping with UDF but getting empty columns.
data = [(1, 3),
(2, 3),
(3, 5),
(4, 10),
(5, 20)]
df = spark.createDataFrame(data, ["int_1", "int_2"])
df.show()
+-----+-----+
|int_1|int_2|
+-----+-----+
| 1| 3|
| 2| 3|... | https://stackoverflow.com/questions/79613107/pyspark-udf-mapping-is-returning-empty-columns | python, apache-spark, pyspark, databricks | 1,746,735,356 |
se_79609979 | stackoverflow | DATA_ENGINEERING | Spark - ReadStream Kafka-Events and delete entries in my S3 bucket based on attributes in Kafka-Event | Spark - ReadStream Kafka-Events and delete entries in my S3 bucket based on attributes in Kafka-Event
I Want to listen to a Kafka-Topic. Every event on that topic represents that an entry of my S3 Bucket can be deleted.
I've got the following Code to read the Events from my Topic:
private static Dataset<Row> readDataF... | https://stackoverflow.com/questions/79609979/spark-readstream-kafka-events-and-delete-entries-in-my-s3-bucket-based-on-attr | java, apache-spark, spark-structured-streaming, spark-java | 1,746,602,310 |
se_79610735 | stackoverflow | DATA_ENGINEERING | Filter apache spark dataframe based on row numbers | Filter apache spark dataframe based on row numbers
I have a spark dataframe df, e.g.
ColumnA ColumnB
10 A
20 B
30 C
What is the equivalent formula for the pandas function df = df.loc[0:1]which leads to the output:
ColumnA ColumnB
10 A
20 B | https://stackoverflow.com/questions/79610735/filter-apache-spark-dataframe-based-on-row-numbers | dataframe, apache-spark | 1,746,626,878 |
se_74156366 | stackoverflow | DATA_ENGINEERING | A request was made to load the default HttpClient provider but one could not be found on the classpath | A request was made to load the default HttpClient provider but one could not be found on the classpath
I'm trying to remove some blobs from Azure storage blob using azure-storage-blob lib, my app is deployed in databricks as a spark job. In addition, my code worked correctly on my local machine
I have the error bellow... | https://stackoverflow.com/questions/74156366/a-request-was-made-to-load-the-default-httpclient-provider-but-one-could-not-be | azure, apache-spark, azure-databricks | 1,666,368,372 |
se_45138742 | stackoverflow | DATA_ENGINEERING | Apache Spark DataSet API : head(n:Int) vs take(n:Int) | Apache Spark DataSet API : head(n:Int) vs take(n:Int)
Apache Spark Dataset API has two methods i.e, head(n:Int) and take(n:Int).
Dataset.Scala source contains
def take(n: Int): Array[T] = head(n)
Couldn't find any difference in execution code between these two functions. why do API has two different methods to yi... | https://stackoverflow.com/questions/45138742/apache-spark-dataset-api-headnint-vs-takenint | apache-spark, apache-spark-sql | 1,500,278,092 |
se_79607498 | stackoverflow | DATA_ENGINEERING | Why does my python function not properly cast the dates despite recognizing the format? | Why does my python function not properly cast the dates despite recognizing the format?
I am attempting to dynamically cast various date formats that come across as a string column but are actually dates. I've gotten pretty far, and this code can correctly identify the dates from the string, but the fields 'Date2' an... | https://stackoverflow.com/questions/79607498/why-does-my-python-function-not-properly-cast-the-dates-despite-recognizing-the | python, dataframe, apache-spark | 1,746,472,102 |
se_79603457 | stackoverflow | DATA_ENGINEERING | Custom logic to split lines of a file to specific partition in Apache Spark | Custom logic to split lines of a file to specific partition in Apache Spark
I am trying to use spark to merge values based on a key in csv file
EmployeeId, Name, Age
1, John, 20
2, Jacob, 40
1, Jane, 30
I want to batch all the records which have the same EmployeeId in the same partition (so John and Jane should go to... | https://stackoverflow.com/questions/79603457/custom-logic-to-split-lines-of-a-file-to-specific-partition-in-apache-spark | apache-spark | 1,746,191,720 |
se_79607269 | stackoverflow | DATA_ENGINEERING | Out of memory for a smaller dataset | Out of memory for a smaller dataset
I have a pyspark job reading the input data volume of just ~50-55GB Parquet data from a delta table. Job is using n2-highmem-4 GCP VM and 1-15 worker with autoscaling. Each workerVM of type n2-highmem-4 has 32GB memory and 4 cores. Each VM has one executor. 22GB is allocated per exe... | https://stackoverflow.com/questions/79607269/out-of-memory-for-a-smaller-dataset | apache-spark, pyspark, databricks, google-cloud-dataproc | 1,746,461,249 |
se_73802324 | stackoverflow | DATA_ENGINEERING | Spark: where is the UUID() function in Scala? | Spark: where is the UUID() function in Scala?
SparkSQL has the uuid() SQL built-in function. However, I couldn't find it in Scala to use with the Dataset API.
Surely, we can just go with:
expr("uuid()")
And it will work properly since it will be parsed as an expression.
Do we have it in the Scala Dataset API? Where? ... | https://stackoverflow.com/questions/73802324/spark-where-is-the-uuid-function-in-scala | scala, apache-spark, pyspark, apache-spark-sql | 1,663,769,828 |
se_79591190 | stackoverflow | DATA_ENGINEERING | Why does my complete custom docker image fail when deployed to a general-purpose compute in Databricks? | Why does my complete custom docker image fail when deployed to a general-purpose compute in Databricks?
TL;DR
I need help when deploying my custom docker image onto a Databricks cluster, knowing if I need to match the exact folder structure for /databricks, or something else, to avoid my error: java.lang.SecurityExcep... | https://stackoverflow.com/questions/79591190/why-does-my-complete-custom-docker-image-fail-when-deployed-to-a-general-purpose | docker, apache-spark, databricks | 1,745,516,335 |
se_49643603 | stackoverflow | DATA_ENGINEERING | Spark deep learning Import error | Spark deep learning Import error
I am trying to replicate a deep learning project from https://medium.com/linagora-engineering/making-image-classification-simple-with-spark-deep-learning-f654a8b876b8 . I am working on spark version 1.6.3. I have installed keras and tensorflow. But everytime i try to import from sparkd... | https://stackoverflow.com/questions/49643603/spark-deep-learning-import-error | apache-spark, pyspark, deep-learning | 1,522,820,574 |
se_79604005 | stackoverflow | DATA_ENGINEERING | Pyspark Dataframe repartition strategy | Pyspark Dataframe repartition strategy
Lets say I have a very large dataframe df. Now I have two smaller dataframes df1 and df2.
df is getting joined with df1 based on key1. And df2 is getting joined with key2 and key3.
Now I know salting is technique could be used in such case. But lets say I want to repartition df a... | https://stackoverflow.com/questions/79604005/pyspark-dataframe-repartition-strategy | apache-spark, pyspark, apache-spark-sql-repartition | 1,746,213,744 |
se_62411830 | stackoverflow | DATA_ENGINEERING | How to find size (in MB) of dataframe in pyspark? | How to find size (in MB) of dataframe in pyspark?
How to find size (in MB) of dataframe in pyspark,
df = spark.read.json("/Filestore/tables/test.json")
I want to find how the size of df or test.json | https://stackoverflow.com/questions/62411830/how-to-find-size-in-mb-of-dataframe-in-pyspark | scala, dataframe, apache-spark, pyspark, databricks | 1,592,320,537 |
se_79600510 | stackoverflow | DATA_ENGINEERING | Delta Live Table append only new data from storage location | Delta Live Table append only new data from storage location
I have the following code, that runs as a DLT pipeline. This is running fine except that I feel that everytime its loading all the data from the storage container (ADLS). So as the data increases in the storage container, the pipeline duration which was ini... | https://stackoverflow.com/questions/79600510/delta-live-table-append-only-new-data-from-storage-location | apache-spark, pyspark, databricks, azure-databricks, dlt | 1,746,022,710 |
se_79045708 | stackoverflow | DATA_ENGINEERING | Pyspark Skewed Data Deduplication Approach | Pyspark Skewed Data Deduplication Approach
I'm trying to dedupe some large skewed data, of uids, timestamps, and another set of session_ids. The second set of IDs somewhat low cardinality. I'm trying to dedupe the Spark DF across these 3 columns. There some high level skewness as these are observation data, and on man... | https://stackoverflow.com/questions/79045708/pyspark-skewed-data-deduplication-approach | apache-spark, pyspark, duplicates, row-number | 1,727,853,416 |
se_77666963 | stackoverflow | DATA_ENGINEERING | spark mongo-connector can't read from DocumentDB | spark mongo-connector can't read from DocumentDB
When i want to show my spark dataframe after:
dataFrame = spark.read.format("mongodb").option("spark.mongodb.database","testdb").option("spark.mongodb.collection", "collection1").load()
dataFrame.show()
It gives the following error:
Py4JJavaError: An error occurred ... | https://stackoverflow.com/questions/77666963/spark-mongo-connector-cant-read-from-documentdb | apache-spark, pyspark, aws-documentdb, mongo-connector | 1,702,650,720 |
se_79600148 | stackoverflow | DATA_ENGINEERING | Is the first function deterministic after executing .orderBy() on the DataFrame? | Is the first function deterministic after executing .orderBy() on the DataFrame?
I learned from this site that the first function is non-deterministic in the case of .orderBy().groupby().
So in the case of this kind of code, is the first function non-deterministic? Or is it deterministic?
from pyspark.sql.functions im... | https://stackoverflow.com/questions/79600148/is-the-first-function-deterministic-after-executing-orderby-on-the-dataframe | python, apache-spark, pyspark | 1,746,009,610 |
se_79592282 | stackoverflow | DATA_ENGINEERING | netcdf-java: Is concurrent read-only supported for independent data in Spark? | netcdf-java: Is concurrent read-only supported for independent data in Spark?
I have a system with 256 cores and fast storage. I have been working with datasets (hundreds of GB) stored in a large number of small files using Spark (scala). Each file consisted of a small number of frames (~50) and frames have no overlap... | https://stackoverflow.com/questions/79592282/netcdf-java-is-concurrent-read-only-supported-for-independent-data-in-spark | apache-spark, netcdf-java | 1,745,575,318 |
se_79597907 | stackoverflow | DATA_ENGINEERING | Definition of shuffling in spark | Definition of shuffling in spark
I know that joins with co-partitioned DataFrames are not considered wide transformations. Here are the definitions of wide and narrow transformations from the original paper.
narrow dependencies, where each
partition of the parent RDD is used by at most one partition of the child RDD,... | https://stackoverflow.com/questions/79597907/definition-of-shuffling-in-spark | apache-spark | 1,745,914,524 |
se_79599659 | stackoverflow | DATA_ENGINEERING | Caused by: java.lang.NoClassDefFoundError: org/apache/kafka/common/serialization/ByteArraySerializer | Caused by: java.lang.NoClassDefFoundError: org/apache/kafka/common/serialization/ByteArraySerializer
I am trying to deploy a scala application which uses structures streaming on a standalone distributed Spark cluster using the spark-submit command and I get the following error:
Exception in thread "main" java.lang.re... | https://stackoverflow.com/questions/79599659/caused-by-java-lang-noclassdeffounderror-org-apache-kafka-common-serialization | scala, apache-spark, apache-kafka, apache-spark-sql, spark-structured-streaming | 1,745,994,287 |
se_79595883 | stackoverflow | DATA_ENGINEERING | Error Running Spark Job from Django API using subprocess.Popen | Error Running Spark Job from Django API using subprocess.Popen
I have created a Django project executable, and I need to run a Spark job from an API endpoint within this executable. I am using subprocess.Popen to execute the spark-submit command, but I am encountering an error when the command is executed.
Here’s the ... | https://stackoverflow.com/questions/79595883/error-running-spark-job-from-django-api-using-subprocess-popen | python, django, apache-spark, pyspark | 1,745,820,940 |
se_23995040 | stackoverflow | DATA_ENGINEERING | Write to multiple outputs by key Spark - one Spark job | Write to multiple outputs by key Spark - one Spark job
How can you write to multiple outputs dependent on the key using Spark in a single Job.
Related: Write to multiple outputs by key Scalding Hadoop, one MapReduce Job
E.g.
sc.makeRDD(Seq((1, "a"), (1, "b"), (2, "c")))
.writeAsMultiple(prefix, compressionCodecOption)... | https://stackoverflow.com/questions/23995040/write-to-multiple-outputs-by-key-spark-one-spark-job | scala, hadoop, output, hdfs, apache-spark | 1,401,713,651 |
se_79593860 | stackoverflow | DATA_ENGINEERING | PySpark Avro Serialization Works but Deserialization Fails with "Attempting to treat union as a RECORD, but it was: UNION" error | PySpark Avro Serialization Works but Deserialization Fails with "Attempting to treat union as a RECORD, but it was: UNION" error
I'm trying to serialize and deserialize data in PySpark (3.1.2) using Avro format, but while serialization works fine, deserialization fails with an error about treating a union as... | https://stackoverflow.com/questions/79593860/pyspark-avro-serialization-works-but-deserialization-fails-with-attempting-to-t | apache-spark, pyspark, avro | 1,745,666,165 |
se_77993867 | stackoverflow | DATA_ENGINEERING | Scala spark UDF function - change to dynamic | Scala spark UDF function - change to dynamic
I am working on a Scala function that basically does the following: it receives a DataFrame that has a column extractive_candidates of type string with values like this:
[
{ 'id': '2568', 'score': 0.80874604, 'contentType': 'web' },
{ 'id': '82', 'score': 0.7834213... | https://stackoverflow.com/questions/77993867/scala-spark-udf-function-change-to-dynamic | scala, apache-spark, reflection, user-defined-functions | 1,707,909,240 |
se_79593732 | stackoverflow | DATA_ENGINEERING | Why does a subquery without matching column names still work in Spark SQL? | Why does a subquery without matching column names still work in Spark SQL?
I have the following two datasets in Spark SQL:
person view:
person = spark.createDataFrame([
(0, "Bill Chambers", 0, [100]),
(1, "Matei Zaharia", 1, [500, 250, 100]),
(2, "Michael Armbrust", 1, [250, 100])])\
.toDF("id", "name", "graduate_prog... | https://stackoverflow.com/questions/79593732/why-does-a-subquery-without-matching-column-names-still-work-in-spark-sql | apache-spark, pyspark, apache-spark-sql | 1,745,656,685 |
se_78754961 | stackoverflow | DATA_ENGINEERING | How Ambari manages Apache hadoop | How Ambari manages Apache hadoop
Ambari is an open source project, but HDP is no longer available for download, so how does Ambari manage components such as Apache Hadoop, Hive, and Spark? Can Ambari directly manage existing Hadoop clusters?
I've finished installing ambari and booted it successfully
At the same time, ... | https://stackoverflow.com/questions/78754961/how-ambari-manages-apache-hadoop | apache-spark, hadoop, hive, ambari | 1,721,137,630 |
se_50606520 | stackoverflow | DATA_ENGINEERING | How to create an empty dataFrame in Spark | How to create an empty dataFrame in Spark
I have a set of Avro based hive tables and I need to read data from them. As Spark-SQL uses hive serdes to read the data from HDFS, it is much slower than reading HDFS directly. So I have used data bricks Spark-Avro jar to read the Avro files from underlying HDFS dir.
Everyt... | https://stackoverflow.com/questions/50606520/how-to-create-an-empty-dataframe-in-spark | scala, apache-spark, apache-spark-sql, avro, spark-avro | 1,527,688,426 |
se_57862801 | stackoverflow | DATA_ENGINEERING | Spark Shell Add Multiple Drivers/Jars to Classpath using spark-defaults.conf | Spark Shell Add Multiple Drivers/Jars to Classpath using spark-defaults.conf
We are using Spark-Shell REPL Mode to test various use-cases and connecting to multiple sources/sinks
We need to add custom drivers/jars in spark-defaults.conf file, I have tried to add multiple jars separated by comma
like
spark.driver.ex... | https://stackoverflow.com/questions/57862801/spark-shell-add-multiple-drivers-jars-to-classpath-using-spark-defaults-conf | scala, apache-spark, properties, classpath | 1,568,077,499 |
se_79585405 | stackoverflow | DATA_ENGINEERING | Does rdd.getNumPartitions() always have the right repartition number before an action? | Does rdd.getNumPartitions() always have the right repartition number before an action?
spark is lazy evaluated, so how does rdd.getNumPartitions() return the correct partition value BEFORE the action is called?
df1 = read_file('s3file1')
df2 = read_file('file2')
print('df1 repartition: ', df1.rdd.getNumPar... | https://stackoverflow.com/questions/79585405/does-rdd-getnumpartitions-always-have-the-right-repartition-number-before-an-a | apache-spark, pyspark, apache-spark-sql-repartition | 1,745,273,307 |
se_39046319 | stackoverflow | DATA_ENGINEERING | How to convert sql table into a pyspark/python data structure and return back to sql in databricks notebook | How to convert sql table into a pyspark/python data structure and return back to sql in databricks notebook
I am running a sql notebook on databricks. I would like to analyze a table with half a billion records in it. I can run simple sql queries on the data. However, I need to change the date column type from str to ... | https://stackoverflow.com/questions/39046319/how-to-convert-sql-table-into-a-pyspark-python-data-structure-and-return-back-to | python, sql, apache-spark, databricks | 1,471,634,397 |
se_73247062 | stackoverflow | DATA_ENGINEERING | Task not serializable issue at window rank function in scala spark | Task not serializable issue at window rank function in scala spark
When i run my code from prod, Am not getting any task not serializable issue while when am trying to call from unit test case. am getting task not serializable from below code. Not getting what is the issue and why this strange behavior. Can anyone hel... | https://stackoverflow.com/questions/73247062/task-not-serializable-issue-at-window-rank-function-in-scala-spark | scala, apache-spark, apache-spark-sql, hive | 1,659,689,350 |
se_74496885 | stackoverflow | DATA_ENGINEERING | Pyspark dropped column not gone | Pyspark dropped column not gone
I have a spark dataframe. I attempt to drop a column, but in some situations the column appears to still be there.
my_range = spark.range(1000).toDF("number")
new_range = my_range.withColumn('num2', my_range.number*2).drop('number')
# can still sort by "number" column
new_range.sort('n... | https://stackoverflow.com/questions/74496885/pyspark-dropped-column-not-gone | dataframe, apache-spark, pyspark, apache-spark-sql | 1,668,820,871 |
se_77305437 | stackoverflow | DATA_ENGINEERING | Group Records by Sequence Spark | Group Records by Sequence Spark
I have the below Dataset
Date | status |
20230101| C |
20230101| C |
20230101| R |
20230101| C |
20230101| C |
20230101| R |
I need to perform the grouping in such a way that each status record is compared to i... | https://stackoverflow.com/questions/77305437/group-records-by-sequence-spark | scala, apache-spark, apache-spark-sql | 1,697,498,824 |
se_78359021 | stackoverflow | DATA_ENGINEERING | How sorting happens behind the scene in spark | How sorting happens behind the scene in spark
consider, I have a single 100 GB csv file, I need to create a ranking column let say 'rank' based on 'customer_spends_in_dollar' col.
df = spark.read.csv('file.csv')
(
df
.withColumn(
'rank',
F.rank().over(
Window().orderBy('customer... | https://stackoverflow.com/questions/78359021/how-sorting-happens-behind-the-scene-in-spark | apache-spark, apache-spark-sql, directed-acyclic-graphs | 1,713,631,992 |
se_79584946 | stackoverflow | DATA_ENGINEERING | how to link c file in Ada with gnatmake? | how to link c file in Ada with gnatmake?
good, I'll get straight to the point. I have a program that needs to run tasks. These three tasks communicate with each other and call C functions for their needs. I wrote functions that call C functions in a package. I leave you the code to see for yourselves.
-- cfunction.ad... | https://stackoverflow.com/questions/79584946/how-to-link-c-file-in-ada-with-gnatmake | c, apache-spark, gcc, ada, gnat | 1,745,252,448 |
se_79586415 | stackoverflow | DATA_ENGINEERING | udf returning Ljava.lang.Object;@ | udf returning Ljava.lang.Object;@
I have a PySpark UDF which when I try to apply to each row for one of the df columns and get a new column, I get a [Ljava.lang.Object;@7e44638d (different value after the @ for each row)
Please see the udf below:
def getLocCoordinates(property_address):
url = "https://maps.googlea... | https://stackoverflow.com/questions/79586415/udf-returning-ljava-lang-object | python, apache-spark, user-defined-functions | 1,745,323,503 |
se_79586138 | stackoverflow | DATA_ENGINEERING | java.io.EOFException PySpark Py4JJavaError always occuring when using user defined function | java.io.EOFException PySpark Py4JJavaError always occuring when using user defined function
I'm doing data preprocessing for this csv file of 1 million rows and hoping to shrink it down to 600000 rows. However I'm having trouble always when doing an apply function on a column in the dataframe because it always raises ... | https://stackoverflow.com/questions/79586138/java-io-eofexception-pyspark-py4jjavaerror-always-occuring-when-using-user-defin | python, dataframe, apache-spark, pyspark, data-analysis | 1,745,315,665 |
se_79585827 | stackoverflow | DATA_ENGINEERING | Creating a Delta table with Parquet V2 checkpoints in databricks | Creating a Delta table with Parquet V2 checkpoints in databricks
I am creating a Delta table in Databricks with V2 checkpoints. To test some scenario in an application I am working on, I need the checkpoint files themselves and not just the sidecar files (e.g. 0000000...10.checkpoint.parquet) to be in Parquet format!
... | https://stackoverflow.com/questions/79585827/creating-a-delta-table-with-parquet-v2-checkpoints-in-databricks | apache-spark, databricks, delta-lake, databricks-python-sdk | 1,745,304,125 |
se_79561771 | stackoverflow | DATA_ENGINEERING | Spark error hadoop reading a file in azure- java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.azure.NativeAzureFileSystem not founded | Spark error hadoop reading a file in azure- java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.azure.NativeAzureFileSystem not founded
I am working locally on a visual studio notebook and would like to connect to the spark pool of synapse azure, but i keep having the problem with hadoop.
The error appears wh... | https://stackoverflow.com/questions/79561771/spark-error-hadoop-reading-a-file-in-azure-java-lang-classnotfoundexception-cl | azure, apache-spark, azure-synapse | 1,744,108,036 |
se_79584972 | stackoverflow | DATA_ENGINEERING | Assistance Required: Resolving S3AFileSystem ClassNotFoundException in Trino | Assistance Required: Resolving S3AFileSystem ClassNotFoundException in Trino
We are trying to setup trino with minIO and have encountered a persistent issue with our Trino configuration. Below is a detailed overview of our setup, the error we are facing, and the steps we have taken to address it.
Our setup uses the fo... | https://stackoverflow.com/questions/79584972/assistance-required-resolving-s3afilesystem-classnotfoundexception-in-trino | apache-spark, hadoop, hive, minio, trino | 1,745,253,292 |
se_62760770 | stackoverflow | DATA_ENGINEERING | Writing Spark DataFrames - what are the possible options that can be set | Writing Spark DataFrames - what are the possible options that can be set
I feel this should be a really obvious question, but is there any documentation on the 'options' for writing Spark DataFrames?
I'm trying to follow the advice in How do you control the size of the output file?, but I'm not getting what I expect. ... | https://stackoverflow.com/questions/62760770/writing-spark-dataframes-what-are-the-possible-options-that-can-be-set | scala, apache-spark, apache-spark-sql | 1,594,054,201 |
se_79574545 | stackoverflow | DATA_ENGINEERING | Spark executor memory limit higher than expected | Spark executor memory limit higher than expected
I'm running Spark on EKS with Fargate. I don't quite understand why the memory of the Spark executor is always different from my expectations. When I set:
spark.executor.memory = 6g
spark.executor.memoryOverhead = 0.10
spark.memory.offHeap.size = 0
the resource limit o... | https://stackoverflow.com/questions/79574545/spark-executor-memory-limit-higher-than-expected | apache-spark, kubernetes, pyspark, amazon-eks, aws-fargate | 1,744,700,680 |
se_74440324 | stackoverflow | DATA_ENGINEERING | SBT gives java.lang.NullPointerException when trying to run spark | SBT gives java.lang.NullPointerException when trying to run spark
I'm trying to compile spark with sbt 1.7.2 on a Linux machine which system is CentOs6.
When I try to run clean command:
./build/sbt clean
I get the following output:
java.lang.NullPointerException
at sun.net.util.URLUtil.urlNoFragString(URLUtil.java... | https://stackoverflow.com/questions/74440324/sbt-gives-java-lang-nullpointerexception-when-trying-to-run-spark | scala, apache-spark, sbt | 1,668,483,066 |
se_79579534 | stackoverflow | DATA_ENGINEERING | How to Preserve Double Quotes in Input Data When Reading with Spark DataFrame? | How to Preserve Double Quotes in Input Data When Reading with Spark DataFrame?
I have a field in the input file: "The Good, the Bad and the Ugly (From ""The Good, the Bad and the Ugly"")" and I need it to remain exactly as "The Good, the Bad and the Ugly (From ""The Good, the Bad and the Ugly"")" after reading it into... | https://stackoverflow.com/questions/79579534/how-to-preserve-double-quotes-in-input-data-when-reading-with-spark-dataframe | apache-spark | 1,744,901,583 |
se_63040466 | stackoverflow | DATA_ENGINEERING | Enforcing Schema for PySpark Job | Enforcing Schema for PySpark Job
We have a bunch of disparate pyspark jobs and have a usecase where two jobs can be chained together to form a seperate 3rd job. So if you have one job 'A' and another job 'B' these jobs can be chained together to form another job 'C'. Obviously this can only happen if the output datafr... | https://stackoverflow.com/questions/63040466/enforcing-schema-for-pyspark-job | python, apache-spark, pyspark, enums | 1,595,440,744 |
se_79581442 | stackoverflow | DATA_ENGINEERING | Pyspark writing dataframe to oracle database table using JDBC | Pyspark writing dataframe to oracle database table using JDBC
I am new to Pyspark and having few clarifications on writing dataframe to oracle database table using JDBC.
As part of the requirement I need to read the data from Oracle table and perform transformation using pyspark and load the final dataframe to oracle ... | https://stackoverflow.com/questions/79581442/pyspark-writing-dataframe-to-oracle-database-table-using-jdbc | python, apache-spark, pyspark, apache-spark-sql | 1,744,995,943 |
se_79579018 | stackoverflow | DATA_ENGINEERING | Spark with availableNow trigger doesn't archive sources | Spark with availableNow trigger doesn't archive sources
I use Spark to read JSON files that appear in a folder everyday with path pattern Yyyy/mm/dd to convert them into Iceberg format. Both folders JSON and Iceberg are in a s3 bucket on different paths.
Im using a stream reader as in
jsondf = spark.readStream.for... | https://stackoverflow.com/questions/79579018/spark-with-availablenow-trigger-doesnt-archive-sources | apache-spark, pyspark, apache-spark-sql, triggers, apache-iceberg | 1,744,885,181 |
se_60645256 | stackoverflow | DATA_ENGINEERING | How do you get batches of rows from Spark using pyspark | How do you get batches of rows from Spark using pyspark
I have a Spark RDD of over 6 billion rows of data that I want to use to train a deep learning model, using train_on_batch. I can't fit all the rows into memory so I would like to get 10K or so at a time to batch into chunks of 64 or 128 (depending on model size).... | https://stackoverflow.com/questions/60645256/how-do-you-get-batches-of-rows-from-spark-using-pyspark | python, apache-spark, pyspark, rdd | 1,583,965,830 |
se_79525380 | stackoverflow | DATA_ENGINEERING | Tune spark sql due to skewed data | Tune spark sql due to skewed data
The SQL in question:
WITH
first_cte AS (
SELECT
s.two_id,
s.d_month,
COUNT(*) AS total,
COUNT(DISTINCT one_id) AS unique_one_id_count
FROM iceberg_db.tab s
GROUP BY s.two_id, s.d_month
)
select *
from first_cte
I run it in g... | https://stackoverflow.com/questions/79525380/tune-spark-sql-due-to-skewed-data | apache-spark, apache-spark-sql, aws-glue, amazon-athena, sqlperformance | 1,742,558,680 |
se_79575513 | stackoverflow | DATA_ENGINEERING | What could be the causes of cache() changing the number of rows of a dataframe? | What could be the causes of cache() changing the number of rows of a dataframe?
The code I have is of the form
def create_df(df1, df2):
df3 = df1.cache().select(...).join(df2.cache(), on=..., how='full')
return df3 # count() is 1
df4 = create_df(df1, df2) # count() is 2
The input dataframes are cached to r... | https://stackoverflow.com/questions/79575513/what-could-be-the-causes-of-cache-changing-the-number-of-rows-of-a-dataframe | apache-spark, pyspark | 1,744,730,158 |
se_79570108 | stackoverflow | DATA_ENGINEERING | Pyspark memory issue when joining and filtering two dataframes | Pyspark memory issue when joining and filtering two dataframes
I am trying to join two dataframes in pyspark.
One dataframe df_dsp_f contains approx 100,000 records. Another dataframe df_slv_f contains approx 99,800 records.
I am using databricks and a serverless cluster for compute.
Objective
To identify the records ... | https://stackoverflow.com/questions/79570108/pyspark-memory-issue-when-joining-and-filtering-two-dataframes | azure, apache-spark, pyspark, azure-databricks | 1,744,439,598 |
se_55979027 | stackoverflow | DATA_ENGINEERING | How to batch up items from a PySpark DataFrame | How to batch up items from a PySpark DataFrame
I have a PySpark data frame and for each (batch of) record(s), I want to call an API. So basically say I have 100000k records, I want to batch up items into groups of say 1000 and call an API. How can I do this with PySpark? Reason for the batching is because the API prob... | https://stackoverflow.com/questions/55979027/how-to-batch-up-items-from-a-pyspark-dataframe | apache-spark, pyspark | 1,556,937,684 |
se_57008441 | stackoverflow | DATA_ENGINEERING | Spark SQL 'Show table extended from db like table gives different result' from Hive | Spark SQL 'Show table extended from db like table gives different result' from Hive
spark.sql("SHOW TABLE EXTENDED IN DB LIKE 'TABLE'")
Beeline >>SHOW TABLE EXTENDED IN DB LIKE 'TABLE';
Both queries have different results.
If I run the same query in Spark it is giving different result than Hive. Format and... | https://stackoverflow.com/questions/57008441/spark-sql-show-table-extended-from-db-like-table-gives-different-result-from-h | apache-spark, apache-spark-sql | 1,562,939,683 |
se_41903342 | stackoverflow | DATA_ENGINEERING | How to change job/stage description in web UI? | How to change job/stage description in web UI?
When I run a job on Apache Spark, the web UI gives a view similar to this:
While this is incredibly useful for me as a developer to see where things are, I think the line numbers in the stage description would be not quite as useful for my support team. To make their ... | https://stackoverflow.com/questions/41903342/how-to-change-job-stage-description-in-web-ui | apache-spark | 1,485,552,726 |
se_79574829 | stackoverflow | DATA_ENGINEERING | Adaptive Query Execution Spark on Databricks with Coalesce | Adaptive Query Execution Spark on Databricks with Coalesce
Something what we might miss as engineers when we talk about AQE - Adaptive Query Execution on Spark/Databricks:
If you're using coalesce() to reduce partitions, AQE won’t touch it. No skew detection. No repartitioning. No optimization. Because coalesce() do n... | https://stackoverflow.com/questions/79574829/adaptive-query-execution-spark-on-databricks-with-coalesce | apache-spark, pyspark, databricks | 1,744,710,325 |
se_79574295 | stackoverflow | DATA_ENGINEERING | Doesn't Delta Table data skipping leverage parquet file metadata? | Doesn't Delta Table data skipping leverage parquet file metadata?
I noticed that querying for the maximum value in a string timestamp column takes 30s with 30+GB of data scanned while querying an actual timestamp column takes 1s with 310MB scanned. Maybe these values aren't comparable due the differing datatypes, ... | https://stackoverflow.com/questions/79574295/doesnt-delta-table-data-skipping-leverage-parquet-file-metadata | apache-spark, apache-spark-sql, databricks, parquet, delta-lake | 1,744,684,517 |
se_56264211 | stackoverflow | DATA_ENGINEERING | How to fix '[errno 2] no such file or directory' error in apache-spark | How to fix '[errno 2] no such file or directory' error in apache-spark
I am trying to set up apache-spark with python and visual studio code. I followed a tutorial up to this point and am not getting any errors with my code but when I try to run the code
spark-submit rdd/testingCode.py
I get a long list o... | https://stackoverflow.com/questions/56264211/how-to-fix-errno-2-no-such-file-or-directory-error-in-apache-spark | python, apache-spark | 1,558,555,518 |
se_79562763 | stackoverflow | DATA_ENGINEERING | Databricks Structured Streaming vs DLT Orchestration | Databricks Structured Streaming vs DLT Orchestration
I want to implement a Medallion model for ETL.
I've been reading about Structured Streaming. Very nice, I specify the streaming chain for each layer, and then Spark triggers the appropriate operations when new data arrives.
I've also read, on the other hand, that I ... | https://stackoverflow.com/questions/79562763/databricks-structured-streaming-vs-dlt-orchestration | apache-spark, databricks, spark-structured-streaming | 1,744,135,596 |
se_79569570 | stackoverflow | DATA_ENGINEERING | Unable to use brotli compression in Azure Databricks runtime 15.4 LTS | Unable to use brotli compression in Azure Databricks runtime 15.4 LTS
spark.conf.set("spark.sql.parquet.compression.codec", "brotli")
df.write.format("delta").mode("overwrite").saveAsTable(table_name, path= delta_table_path)
Error message is :
spark.conf.set("spark.sql.parquet.compression.codec", "brotli")
df.write.... | https://stackoverflow.com/questions/79569570/unable-to-use-brotli-compression-in-azure-databricks-runtime-15-4-lts | java, apache-spark, hadoop, azure-databricks | 1,744,398,831 |
se_77957991 | stackoverflow | DATA_ENGINEERING | Pyspark Exceptions : [JAVA_GATEWAY_EXITED] Java gateway process exited before sending its port number | Pyspark Exceptions : [JAVA_GATEWAY_EXITED] Java gateway process exited before sending its port number
Yes, I know I'm going to be told it's a duplicate, but it's not.
When I try to connect to my Apache Spark via my Bitnami/Spark container, I always get this error.
Error : unable to find or load main class org.apache.s... | https://stackoverflow.com/questions/77957991/pyspark-exceptions-java-gateway-exited-java-gateway-process-exited-before-se | python, java, docker, apache-spark, pyspark | 1,707,341,101 |
se_77583167 | stackoverflow | DATA_ENGINEERING | py4j.Py4JException: Method sql([class java.lang.String, class [Ljava.lang.Object;]) does not exist | py4j.Py4JException: Method sql([class java.lang.String, class [Ljava.lang.Object;]) does not exist
I am new to spark. I am getting this error when i try to run pyspark through jupyter notebook on my hadoop masternode.
Using
Apache spark = 3.4.0
python 3.11
Please check the code given below
from pyspark.sql import Spar... | https://stackoverflow.com/questions/77583167/py4j-py4jexception-method-sqlclass-java-lang-string-class-ljava-lang-object | python, apache-spark, pyspark | 1,701,408,370 |
se_75904932 | stackoverflow | DATA_ENGINEERING | Spark last window dont flush in append mode | Spark last window dont flush in append mode
The problem is very simple, when you use TUMBLING window with append mode, then the window is closed only when the next message arrives (+watermark logic).
In the current implementation, if you stop incoming streaming data, the last window will NEVER close and we LOSE the l... | https://stackoverflow.com/questions/75904932/spark-last-window-dont-flush-in-append-mode | apache-spark, pyspark, apache-spark-sql, spark-streaming, spark-structured-streaming | 1,680,336,298 |
se_79563470 | stackoverflow | DATA_ENGINEERING | Spark: How to measure total memory allocated for all executors in an app? | Spark: How to measure total memory allocated for all executors in an app?
What's the best way to measure the total memory footprint of a Spark App using the SparkListener metrics?
I think this should come from the taskListener but not seeing it.
SparkListenerTaskEnd.taskMetrics.peakExecutionMemory is only per task, no... | https://stackoverflow.com/questions/79563470/spark-how-to-measure-total-memory-allocated-for-all-executors-in-an-app | apache-spark | 1,744,173,743 |
se_69589409 | stackoverflow | DATA_ENGINEERING | Kill Snowflake queries from Spark Connector | Kill Snowflake queries from Spark Connector
Is there a way to kill Snowflake queries using the Spark connector ? Alternatively is there a way to grab the last last query id or session id in Spark to kill it outside of Spark.
The use case is user controlled long running Spark jobs with long running Snowflake queries. ... | https://stackoverflow.com/questions/69589409/kill-snowflake-queries-from-spark-connector | scala, apache-spark, snowflake-cloud-data-platform | 1,634,324,231 |
se_74897409 | stackoverflow | DATA_ENGINEERING | Pyspark : How to take Minimum in the timestamp column? | Pyspark : How to take Minimum in the timestamp column?
In pyspark , i tried to do this
df = df.select(F.col("id"),
F.col("mp_code"),
F.col("mp_def"),
F.col("mp_desc"),
F.col("mp_code_desc"),
F.col("zdmtrt06_zstation").alias... | https://stackoverflow.com/questions/74897409/pyspark-how-to-take-minimum-in-the-timestamp-column | apache-spark, pyspark | 1,671,782,568 |
se_79565838 | stackoverflow | DATA_ENGINEERING | Generating data checksum for nested data structures | Generating data checksum for nested data structures
What would be a good approach to generate a data checksum/hash for nested data (including arrays) in Spark, using the PySpark dataframe api?
The ordering of elements in an array could be differend, but the data the same (see example below). The checksum should be the... | https://stackoverflow.com/questions/79565838/generating-data-checksum-for-nested-data-structures | apache-spark, pyspark, data-engineering | 1,744,265,386 |
se_79569395 | stackoverflow | DATA_ENGINEERING | Spark AQE and Skew Join configurations not being applied | Spark AQE and Skew Join configurations not being applied
I am experiencing data skew issues in spark, specifically during joins and window functions. I have tried many of the spark performance tuning configurations recommended but none appear to be working. I explicitly define these spark configs and verified they are... | https://stackoverflow.com/questions/79569395/spark-aqe-and-skew-join-configurations-not-being-applied | apache-spark, apache-spark-sql, skew | 1,744,391,495 |
se_44500166 | stackoverflow | DATA_ENGINEERING | Add a constant struct column to a Spark DataFrame | Add a constant struct column to a Spark DataFrame
I want to load a struct from a database collection, and attach it as a constant column to every row in a target DataFrame.
I can load the column I need as a DataFrame with one row, then do a crossJoin to paste it onto each row of the target:
val parentCollectionDF = ... | https://stackoverflow.com/questions/44500166/add-a-constant-struct-column-to-a-spark-dataframe | dataframe, scala, apache-spark, apache-spark-sql, scala-spark | 1,497,272,515 |
se_74192463 | stackoverflow | DATA_ENGINEERING | Difference between alias and withColumnRenamed | Difference between alias and withColumnRenamed
What is the difference between:
my_df = my_df.select(col('age').alias('age2'))
and
my_df = my_df.select(col('age').withColumnRenamed('age', 'age2')) | https://stackoverflow.com/questions/74192463/difference-between-alias-and-withcolumnrenamed | apache-spark, pyspark | 1,666,692,881 |
se_79566994 | stackoverflow | DATA_ENGINEERING | Connecting Local Visual Studio Notebook to Azure Synapse and Using a Spark Pool | Connecting Local Visual Studio Notebook to Azure Synapse and Using a Spark Pool
Hi is it possible to connect me from local (visual studio notebook) to Azure Synapse and use a spark pool created in synapse?
Something like this:
spark = SparkSession.builder \
.appName("AzureSynapse") \
.config("spark.sql.warehou... | https://stackoverflow.com/questions/79566994/connecting-local-visual-studio-notebook-to-azure-synapse-and-using-a-spark-pool | azure, apache-spark, azure-synapse | 1,744,296,766 |
se_79568078 | stackoverflow | DATA_ENGINEERING | FileNotFound Exception occurs when pyspark write after persist().count() | FileNotFound Exception occurs when pyspark write after persist().count()
I encountered java.io.FileNotFoundException in AWS EMR batch.
My code processes data as below :
updateDF = spark.read.load(paths, ..)
userIDs = uniqueList(matchedUserIDs)
nones = [None for _ in range(len(userIDs))]
updateDF = updateDF.replace(us... | https://stackoverflow.com/questions/79568078/filenotfound-exception-occurs-when-pyspark-write-after-persist-count | apache-spark, amazon-s3, pyspark, amazon-emr, filenotfoundexception | 1,744,350,382 |
se_79412688 | stackoverflow | DATA_ENGINEERING | How does one differentiate dataframes from connect-dataframes in Pyspark? | How does one differentiate dataframes from connect-dataframes in Pyspark?
I realized that some Pyspark objects may change when used in Databricks.
For instance:
from pyspark.sql import Column, DataFrame, SparkSession
isinstance(spark, SparkSession)
isinstance(a_df, DataFrame)
isinstance(a_col, Column)
This code isn... | https://stackoverflow.com/questions/79412688/how-does-one-differentiate-dataframes-from-connect-dataframes-in-pyspark | apache-spark, pyspark, databricks-connect | 1,738,693,644 |
se_79562555 | stackoverflow | DATA_ENGINEERING | Flattening a large array JSON in PySpark and converting to dataframe | Flattening a large array JSON in PySpark and converting to dataframe
I've a couple of tables that are sent from source system in array Json format, like in the below example.
Each table could have different number of rows. For instance, the Table1 could have 1m rows, and Table2 could have 10m.
schema = StructType([
St... | https://stackoverflow.com/questions/79562555/flattening-a-large-array-json-in-pyspark-and-converting-to-dataframe | json, apache-spark, pyspark, databricks | 1,744,128,306 |
se_79557519 | stackoverflow | DATA_ENGINEERING | Why does .collect() cause a shuffle while .show() does not? | Why does .collect() cause a shuffle while .show() does not?
I’m learning Spark using the book Spark: The Definitive Guide and came across some behavior I’m trying to understand.
I am reading a csv file which has 3 columns: DEST_COUNTRY_NAME, ORIGIN_COUNTRY_NAME, count. The dataset has a total of 256 rows.
Here’s the c... | https://stackoverflow.com/questions/79557519/why-does-collect-cause-a-shuffle-while-show-does-not | apache-spark, pyspark, spark-shuffle | 1,743,886,612 |
se_74643390 | stackoverflow | DATA_ENGINEERING | Error connecting to Cosmos DB from Databricks: AnalysisException: Catalog 'cosmoscatalog' not found | Error connecting to Cosmos DB from Databricks: AnalysisException: Catalog 'cosmoscatalog' not found
I've followed the documentation from start to end.
I'm trying to connect to a CosmosDb so I can write data to it.
My Databricks cluster runtime version is:
11.3 LTS
I have installed the cosmos DB Spark connector... | https://stackoverflow.com/questions/74643390/error-connecting-to-cosmos-db-from-databricks-analysisexception-catalog-cosmo | python, apache-spark, azure-cosmosdb, databricks | 1,669,904,574 |
se_78904399 | stackoverflow | DATA_ENGINEERING | Spark Delta Table dependencies are not resolved | Spark Delta Table dependencies are not resolved
I am create a delta table using python, but while we submit code jar dependencies are not resolved:
Below is my code:
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StructField, StringType, DecimalType, TimestampType, LongType
from delta i... | https://stackoverflow.com/questions/78904399/spark-delta-table-dependencies-are-not-resolved | apache-spark, delta-lake, delta, delta-live-tables | 1,724,390,708 |
se_79564000 | stackoverflow | DATA_ENGINEERING | Creating an Iceberg table with a geometry column with Sedona | Creating an Iceberg table with a geometry column with Sedona
I'm trying to create an Iceberg table with a geometry column in this example:
import org.apache.sedona.sql.utils.SedonaSQLRegistrator
SedonaSQLRegistrator.registerAll(spark)
val stmt = """
CREATE TABLE local.myschema.geotable (id string, geom geometry)
... | https://stackoverflow.com/questions/79564000/creating-an-iceberg-table-with-a-geometry-column-with-sedona | apache-spark, apache-spark-sql, apache-iceberg, apache-sedona | 1,744,191,888 |
se_79560817 | stackoverflow | DATA_ENGINEERING | Compare Column aggregations in Spark | Compare Column aggregations in Spark
I have the following tests where the first one succeeds but the second and third always fail.
package example
import org.apache.spark.sql.{Row, SparkSession}
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.{DoubleType, StringType, StructField, StructType}... | https://stackoverflow.com/questions/79560817/compare-column-aggregations-in-spark | scala, apache-spark | 1,744,061,221 |
se_79543186 | stackoverflow | DATA_ENGINEERING | Adding more data causes Pandas UDF to return error | Adding more data causes Pandas UDF to return error
I am new to Pyspark and I have created a pandas udf. The purpose of this udf is to accept a series and apply an ML model on it. I have data that has these columns:
ID, models_name, prices, units_sold, date.....
ID is basically a product id and is a string. models_name... | https://stackoverflow.com/questions/79543186/adding-more-data-causes-pandas-udf-to-return-error | python, pandas, apache-spark, pyspark, user-defined-functions | 1,743,248,789 |
se_79549505 | stackoverflow | DATA_ENGINEERING | Spark Java BigQuery | Spark Java BigQuery
I have two GCP projects such as proj-A & proj-B. And, proj-A has a dataset under that there a view created (proj-A.proj_A_dataset.test_table).
I am trying to access this view from proj-B. proj-B has a ServiceAccount and this SA has provided with proj-B dataset "BigQuery Data Viewer" permissions alr... | https://stackoverflow.com/questions/79549505/spark-java-bigquery | apache-spark, google-bigquery | 1,743,559,010 |
se_79556096 | stackoverflow | DATA_ENGINEERING | Adding jar files to AWS Glue script versus notebook | Adding jar files to AWS Glue script versus notebook
I've noticed something odd in AWS Glue - when you create a spark notebook and pass some magic commands to set up the notebook it has no problems
For example:
%idle_timeout 2880
%worker_type G.1X
%number_of_workers 10
%additional_python_modules apache-sedona==1.6.1,s... | https://stackoverflow.com/questions/79556096/adding-jar-files-to-aws-glue-script-versus-notebook | amazon-web-services, apache-spark, aws-glue | 1,743,794,000 |
se_78712053 | stackoverflow | DATA_ENGINEERING | EMR-Spark Job creating max 1000 partitions/task when AQE is enabled | EMR-Spark Job creating max 1000 partitions/task when AQE is enabled
I see always 1000 task/partitions getting created for a spark jobs with AQE enabled. If I execute job for monthly(4 times weekly data) or a week data, the shuffle partitions are same.Whis is nothing but number of task running is 1000. Hence it's throw... | https://stackoverflow.com/questions/78712053/emr-spark-job-creating-max-1000-partitions-task-when-aqe-is-enabled | apache-spark, pyspark, amazon-emr | 1,720,190,521 |
se_76370784 | stackoverflow | DATA_ENGINEERING | Remove duplicates when values equal or subset each other in Spark dataset | Remove duplicates when values equal or subset each other in Spark dataset
I would like to remove duplicates in Spark dataset only if the values in the same column are the same or subset of each other.
Example:
ID
DATA
1
Newyork City
2
Berlin DE
3
Berlin
4
Newyork City US
5
Paris FR
6
Paris
I woul... | https://stackoverflow.com/questions/76370784/remove-duplicates-when-values-equal-or-subset-each-other-in-spark-dataset | apache-spark | 1,685,515,352 |
se_79560839 | stackoverflow | DATA_ENGINEERING | How to re-order and upsert records after combining two dataframes | How to re-order and upsert records after combining two dataframes
I have below similar scenarios.
I have a source table which doesn't contain an id and I need to merge the records from the source into the target table which contains id which is consistent in the order.
SourceDF
+-------+---------+-------+-------------... | https://stackoverflow.com/questions/79560839/how-to-re-order-and-upsert-records-after-combining-two-dataframes | python, sql, apache-spark, pyspark, databricks | 1,744,061,999 |
se_37871194 | stackoverflow | DATA_ENGINEERING | How to tune spark executor number, cores and executor memory? | How to tune spark executor number, cores and executor memory?
Where do you start to tune the above mentioned params. Do we start with executor memory and get number of executors, or we start with cores and get the executor number. I followed the link. However got a high level idea, but still not sure how or where to ... | https://stackoverflow.com/questions/37871194/how-to-tune-spark-executor-number-cores-and-executor-memory | apache-spark | 1,466,121,792 |
se_79332304 | stackoverflow | DATA_ENGINEERING | Databricks - loading files with a prefix and by timestamp (metadata) from folder | Databricks - loading files with a prefix and by timestamp (metadata) from folder
I've got a project on Databricks to load XML files from one folder.
There are different logic for each type of file, so I've made several notebooks for each type of file that starts with a prefix.
Example: Account_20240101.xml
My question... | https://stackoverflow.com/questions/79332304/databricks-loading-files-with-a-prefix-and-by-timestamp-metadata-from-folder | xml, apache-spark, pyspark, databricks, elt | 1,736,146,693 |
se_79550009 | stackoverflow | DATA_ENGINEERING | Does auto compaction break z-ordering? | Does auto compaction break z-ordering?
Does auto compaction break existing z-ordered tables in delta lake? | https://stackoverflow.com/questions/79550009/does-auto-compaction-break-z-ordering | apache-spark, optimization, databricks, delta-lake, data-lake | 1,743,580,408 |
se_76321485 | stackoverflow | DATA_ENGINEERING | Py4JJavaError: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.spark | Py4JJavaError: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.spark
I'm trying to connect pyspark to SQLServer v.16 (reading a table). My spark and pyspark versions are same, I've also downloaded spark mssql server connector (spark-mssql-connector_2.11_2.4-1.0.2.jar) but I don't know what's the right p... | https://stackoverflow.com/questions/76321485/py4jjavaerror-java-lang-classnotfoundexception-com-microsoft-sqlserver-jdbc-sp | python, apache-spark, pyspark, jdbc | 1,684,916,692 |
se_32916838 | stackoverflow | DATA_ENGINEERING | Which version of Spark to download? | Which version of Spark to download?
I understand you can download Spark source code (1.5.1), or prebuilt binaries for various versions of Hadoop. As of Oct 2015, the Spark webpage http://spark.apache.org/downloads.html has prebuilt binaries against Hadoop 2.6+, 2.4+, 2.3, and 1.X.
I'm not sure what version to downloa... | https://stackoverflow.com/questions/32916838/which-version-of-spark-to-download | hadoop, amazon-web-services, amazon-s3, apache-spark | 1,443,825,355 |
se_76059598 | stackoverflow | DATA_ENGINEERING | How to resolve harmless "java.nio.file.NoSuchFileException: xxx/hadoop-client-api-3.3.4.jar" error in Spark when run `sbt run`? | How to resolve harmless "java.nio.file.NoSuchFileException: xxx/hadoop-client-api-3.3.4.jar" error in Spark when run `sbt run`?
I have a simple Spark application in Scala 2.12.
My App
find-retired-people-scala/project/build.properties
sbt.version=1.8.2
find-retired-people-scala/src/main/scala/com/hongbomiao... | https://stackoverflow.com/questions/76059598/how-to-resolve-harmless-java-nio-file-nosuchfileexception-xxx-hadoop-client-ap | java, scala, apache-spark, hadoop, sbt | 1,681,948,500 |
se_67756929 | stackoverflow | DATA_ENGINEERING | Controlling Decimal Precision Overflow in Spark | Controlling Decimal Precision Overflow in Spark
We are using Spark 2.4.x.
We have a precision loss for one of our division operations (69362.86 / 111862.86) Both of these values are defined as decimal(38,3) on the table. When run through beeline, it produces 0.620070504187002 but when run through spark it produces 0.6... | https://stackoverflow.com/questions/67756929/controlling-decimal-precision-overflow-in-spark | apache-spark, apache-spark-sql, decimal | 1,622,338,014 |
se_42995706 | stackoverflow | DATA_ENGINEERING | Spark remote job | Spark remote job
while I'm trying to submit a spark job from eclipse onto a remote hadoop cluster(yarn) getting below error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/Logging
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoade... | https://stackoverflow.com/questions/42995706/spark-remote-job | apache-spark | 1,490,347,554 |
se_79538598 | stackoverflow | DATA_ENGINEERING | Why does Spark insist on shuffling data when joining dataframes partitioned by range? | Why does Spark insist on shuffling data when joining dataframes partitioned by range?
I have a large (TBs) dataset consisting of multiple tables. The end user needs to be able to join them efficiently. The unique key for each record is continuous, and it is important that records with key values close to one another a... | https://stackoverflow.com/questions/79538598/why-does-spark-insist-on-shuffling-data-when-joining-dataframes-partitioned-by-r | apache-spark, pyspark | 1,743,072,616 |
se_79417401 | stackoverflow | DATA_ENGINEERING | Spark Overwrite table , getting data loss when terminated at insertion stage | Spark Overwrite table , getting data loss when terminated at insertion stage
Objective :
we need to read the table in spark application and trasform the data and rewrite the same table
Senario :
I am trying to overwrite external non partitioned table with spark
Since same data read and write was not possible , we are ... | https://stackoverflow.com/questions/79417401/spark-overwrite-table-getting-data-loss-when-terminated-at-insertion-stage | apache-spark, hive, hdfs, external, impala | 1,738,834,703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.