Skip to content

Commit

Permalink
Flesh out the target example and add it to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Sep 8, 2023
1 parent 1c8aab2 commit c868859
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,27 @@ jobs:
- name: Run sql examples
run:
./run_sql_examples.sh
run-target-examples:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Spark and friends
uses: actions/cache@v3
with:
path: |
spark*.tgz
iceberg*.jar
key: spark-artifacts
- name: Cache Data
uses: actions/cache@v3
with:
path: |
data/fetched/*
key: data-fetched
- name: Run sql examples
run:
cd target-validator; ./runme.sh
run-pyspark-examples:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions target-validator/ex.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
detailedErrors: true
numKeyCols: 4
# We might have a large number of errors so just show the first 5
numErrorsToReport: 5

Expand All @@ -10,8 +11,8 @@ email:
- [email protected]

tables:
- db: uk_data
table: adult
- db: gender_paygaps
table: uk
# Columns that taken together uniquely specifies each row (think of groupBy)
keyColumns:
- CompanyNumber
Expand Down
11 changes: 11 additions & 0 deletions target-validator/runme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
source ../env_setup.sh
set -ex
export SPARK_VERSION=${SPARK_VERSION:-3.4.1}
git clone [email protected]:holdenk/data-validator.git
cd data-validator
git checkout upgrade-to-modern-spark
sbt -Dspark=${SPARK_VERSION} clean assembly
export JAR_PATH="$(pwd)/target/scala-2.12/data-validator-assembly-${SPARK_VERSION}_0.15.0.jar"
cd ..
spark-submit --master local $JAR_PATH --config ex.yaml || echo "Failed as expected."

0 comments on commit c868859

Please sign in to comment.