infiniflow / infiniflow/infinity

Embedded SDK filters crash with AttributeError on current sqlglot

Open Beginner friendly
#3,458 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4.7k
Forks
445
Avg merge
2d 2h
Merged PRs (30d)
7

Description

**Description**

Every comparison, AND/OR, NOT, parenthesized, or negated filter crashes in embedded mode (`infinity.connect("")`) with current sqlglot releases:

```python
table.output(["*"]).filter("c1 > 1").to_df()
# AttributeError: 'GTE' object has no attribute 'hashable_args'
```

`traverse_conditions()` in `infinity_embedded/local_infinity/utils.py` reads operands via `cons.hashable_args` in the Binary/Not/Paren/Neg arms. sqlglot removed that property (the repo pins `sqlglot[rs]>=27.10.0`; current releases are 30.x), so filter traversal dies immediately. The thrift SDK never used it, which is why only the embedded package is affected.

There is a second, latent bug in the same lines: on sqlglot versions that still had `hashable_args`, it yielded a frozenset of `(key, value)` pairs, so the argument order of comparison filters was hash-dependent - `c1 > 1` could be built with flipped operands depending on the run. Taking the operands explicitly (`cons.this`, `cons.expression`) fixes both.

Contributor guide

Open the contributing guide

Research direction

Start in infinity_embedded/local_infinity/utils.py at traverse_conditions(), focusing on the Binary, Not, Paren, and Neg arms. Reproduce the embedded filter examples from the issue, then verify that comparisons and logical or parenthesized filters no longer crash and preserve operand order with current sqlglot releases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
backend-api-design, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.