Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mkdocs/docs/expression-dsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ complex_filter = And(
EqualTo("type", "enterprise")
)
)
```
```
11 changes: 7 additions & 4 deletions mkdocs/docs/row-filter-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

# Row Filter Syntax

In addtion to the primary [Expression DSL](expression-dsl.md), PyIceberg provides a string-based statement interface for filtering rows in Iceberg tables. This guide explains the syntax and provides examples for supported operations.
In addition to the primary [Expression DSL](expression-dsl.md), PyIceberg provides a string-based statement interface for filtering rows in Iceberg tables. This guide explains the syntax and provides examples for supported operations.

The row filter syntax is designed to be similar to SQL WHERE clauses. Here are the basic components:

### Column References
## Column References

Columns can be referenced using either unquoted or quoted identifiers:

Expand All @@ -30,7 +30,7 @@ column_name
"column.name"
```

### Literals
## Literals

The following literal types are supported:

Expand Down Expand Up @@ -137,6 +137,7 @@ price IS NOT NULL AND price > 100 AND quantity > 0
## Common Pitfalls

1. **String Quoting**: Always use single quotes for string literals. Double quotes are reserved for column identifiers.

```sql
-- Correct
name = 'John'
Expand All @@ -146,6 +147,7 @@ price IS NOT NULL AND price > 100 AND quantity > 0
```

2. **Wildcard Usage**: The `%` wildcard in LIKE patterns can only appear at the end.

```sql
-- Correct
name LIKE 'John%'
Expand All @@ -155,6 +157,7 @@ price IS NOT NULL AND price > 100 AND quantity > 0
```

3. **Case Sensitivity**: Boolean literals (`true`/`false`) are case insensitive, but string comparisons are case sensitive.

```sql
-- All valid
is_active = true
Expand All @@ -169,4 +172,4 @@ price IS NOT NULL AND price > 100 AND quantity > 0

1. For complex use cases, use the primary [Expression DSL](expression-dsl.md)
2. When using multiple conditions, consider the order of operations (NOT > AND > OR)
3. For string comparisons, be consistent with case usage
3. For string comparisons, be consistent with case usage