apache_spark
Table of Contents
Apache Spark
Apache Spark (Framework)
- Framework for:
- data profiling
- data cleansing
- data validation
- data standardization
- data enrichment
- Installation on my computer:
C:\v\pgm\spark-3.5.0-bin-hadoop3
- Code repo:
- Docs
- Articles
-
- Data profiling
describe()summary()- …
- Data cleansing
- na() - Returns a DataFrameNaFunctions for working with missing data.
drop()- remove rows
fill()- replaces NULLS with
valXYZ
replace()- replaces
valXwithvalY
dropDuplicates()- removes identical rows
- Statistics
summary()agg()→ See https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/RelationalGroupedDataset.htmlmin()max()avg()stddev()count()pivot()sum()
-
- List of all “stat” functions: https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/DataFrameStatFunctions.html
- Libraries built for / on top of Apache Spark
- Deequ → https://github.com/awslabs/deequ
- library for defining “unit tests for data”, which measure data quality in large datasets.
sparktest project
My IntelliJ project to test Spark: C:\v\IdeaProjects\sparktest
- “Outliers” test →
SparkTester.getInvalidData() - “Diff” test →
SparkTester.getWithDiffColumn()
Misc
Troubleshooting
...module java.base does not export sun.nio.ch...
Important:
To not to have the problems like cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch … it is necessary to add some parameters for Java VM:
--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
apache_spark.txt · Last modified: by kalaschnikow
