# DataQualityTargetTable

The Glue table a `DataQualityRuleset` evaluates.

Obtainable from: DataQualityTargetTable.fromTable, DataQualityTargetTable.fromTableName

- Source: [`aws-glue/lib/data-quality-ruleset.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-glue/lib/data-quality-ruleset.ts#L14)
- Type last changed: v2.270.0 · 17 Sep 2026

## Example

TypeScript:

```ts
declare const database: glue.IDatabase;
new glue.DataQualityRuleset(this, 'MyRuleset', {
  rulesetName: 'my_ruleset',
  dqdl: glue.Dqdl.fromString('Rules = [ RowCount > 100, IsComplete "order_id" ]'),
  targetTable: glue.DataQualityTargetTable.fromTableName(database, 'my_table'),
});
```

Python:

```python
# database: glue.IDatabase

glue.DataQualityRuleset(self, "MyRuleset",
    ruleset_name="my_ruleset",
    dqdl=glue.Dqdl.from_string("Rules = [ RowCount > 100, IsComplete \"order_id\" ]"),
    target_table=glue.DataQualityTargetTable.from_table_name(database, "my_table")
)
```

Java:

```java
IDatabase database;

DataQualityRuleset.Builder.create(this, "MyRuleset")
        .rulesetName("my_ruleset")
        .dqdl(Dqdl.fromString("Rules = [ RowCount > 100, IsComplete \"order_id\" ]"))
        .targetTable(DataQualityTargetTable.fromTableName(database, "my_table"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
IDatabase database;

new DataQualityRuleset(this, "MyRuleset", new DataQualityRulesetProps {
    RulesetName = "my_ruleset",
    Dqdl = Dqdl.FromString("Rules = [ RowCount > 100, IsComplete \"order_id\" ]"),
    TargetTable = DataQualityTargetTable.FromTableName(database, "my_table")
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var database IDatabase

glue.NewDataQualityRuleset(this, jsii.String("MyRuleset"), &DataQualityRulesetProps{
	RulesetName: jsii.String("my_ruleset"),
	Dqdl: glue.Dqdl_FromString(jsii.String("Rules = [ RowCount > 100, IsComplete \"order_id\" ]")),
	TargetTable: glue.DataQualityTargetTable_FromTableName(database, jsii.String("my_table")),
})
```

## Properties

- `databaseName`: string — The database name of the target table.

- `tableName`: string — The table name of the target table.

## Methods

- `fromTable(database: IDatabaseRef, table: ITable): DataQualityTargetTable // chainable` (static) — Target an L2 table in a database.

  **Parameters**

  - `database` — the database that holds the table.
  - `table` — the table to evaluate.

- `fromTableName(database: IDatabaseRef, tableName: string): DataQualityTargetTable // chainable` (static) — Target a table by name in a database.

  Use this when the table is not
  modeled as an L2 construct (e.g. it is imported or created elsewhere).

  **Parameters**

  - `database` — the database that holds the table.
  - `tableName` — the name of the table to evaluate.
