Skip to content

pushDownPredicate is not working for customSQL rules with start_data_quality_ruleset_evaluation_run

0

I am having customSQL rules for Glue data quality check along with the recommended rules. While calling start_data_quality_ruleset_evaluation_run, i am also passing pushDownPredicate for 'enddate' partition column. pushDownPredicate is working fine for the recommended rules and not for the customSQL rules. Is there any possible way of applying partition filters for the customSQL rules while triggering the data quality evaluation ?

I have customSQL rule like below and passing pushDownPredicate as 'enddate = '2024-11-27''

customSQL 'select count(*) from db_name.table_name' > 0

In the data quality results, it is considering record count of entire table and not applying the pushDownPredicate filtering. I have also tried catalogPartitionPredicate and it is the same case with it.

AWS

asked 2 years ago163 views

1 Answer
0
# Example in Glue ETL script
from awsglue.context import GlueContext
from awsglue.job import Job
import sys

glueContext = GlueContext(SparkContext.getOrCreate())
job = Job(glueContext)

# Assuming you're using a DynamicFrame
df = glueContext.create_dynamic_frame.from_catalog(
    database="db_name", 
    table_name="table_name", 
    push_down_predicate="enddate = '2024-11-27'"
)

# Convert to DataFrame, create a temporary view
df.toDF().createOrReplaceTempView("filtered_table")

# Now use this view in your customSQL
customSQL_rule = "customSQL 'select count(*) from filtered_table' > 0"

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.