Skip to content

Glue DQ using Glue Data Catalog Error - Exception in User Class: java.lang.NoClassDefFoundError : amzn/shaded/net/sf/jsqlparser/util/TablesNamesFinder

0

I am trying to test Glue DQ using glue catalog for a table in AWS Glue, But I am facing error for data quality rule as I result DQ is getting failed with error "Exception in User Class: java.lang.NoClassDefFoundError : amzn/shaded/net/sf/jsqlparser/util/TablesNamesFinder".

I am facing this issue when I mention this rule in Ruleset Rules = [CustomSql "select Col1,Col2 from primary" with threshold > 0]

I am facing this in CustomSql Query whenever I mention columns in the query, I have verified rule is not working with primary or dbname.tablename in my query As a result facing error, Enter image description here. Also in Cloudwatch logs the error is not getting displayed in the logstream.

But when I write query CustomSql "select count(*) from primary" between 10 and 100, the ruleset is getting completed with desired results.

How can I resolve this issue.

1 Answer
0

The error you're encountering with AWS Glue Data Quality is related to how you're using the CustomSQL rule type. Based on the information provided, there are a few key points to address:

  1. For Row Level CustomSQL rules, you need to select at least one column from your primary table that matches the input dataset. This is required for AWS Glue Data Quality to provide row-level results.

  2. Your working query CustomSql "select count(*) from primary" between 10 and 100 is valid for OVERALL CustomSQL DQ rule, but not for Row Level Custom SQL. This explains why it works while your column-specific query fails.

  3. When using CustomSQL with columns, you should ensure that:

  • You select a Primary Key from your table or a set of columns that form a composite key
  • You only select keys from your primary table (not from reference tables)
  • The columns you select in your SQL query must exist in the input dataset

To resolve this issue, try the following:

  1. Verify that the columns "Col1" and "Col2" actually exist in your table with exact spelling and case

  2. Ensure your rule is properly formatted with the correct syntax. For example:

Rules = [CustomSQL "select Col1, Col2 from primary" with threshold > 0]
  1. Make sure you're using double quotes consistently in your rule definition, not single quotes

  2. If you're trying to perform row-level validation, modify your query to include a WHERE clause that filters for the condition you want to check

  3. If you're still encountering the same error, try using a simpler query first to test if the issue is with specific columns or with the CustomSQL functionality in general

The "NoClassDefFoundError" suggests there might be a dependency issue with the jsqlparser library that AWS Glue Data Quality uses to parse your SQL query. This could be related to how your specific query is being processed.
Sources
Troubleshooting AWS Glue Data Quality errors - AWS Glue
CustomSQL - AWS Glue

answered a year 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.