apache / apache/datafusion

Filter operation (GT AND LT) on Float type result error

Open
#13,078 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Describe the bug

### SQL Query: Drone Information Table Operations

#### Create Table
```sql
CREATE TABLE droneinfo_test_where (ts timestamp, signal_strength INT, speed FLOAT, calibration_method STRING);
```

#### Insert Data
```sql
INSERT INTO droneinfo_test_where VALUES(NOW(), 80, 500.2, 'method2');
```

#### Select Query
```sql
SELECT * FROM droneinfo_test_where WHERE signal_strength >= 80 AND speed <= 500.2;
```

#### Expected Result
```
+----+-----------------+-------+--------------------+
| ts | signal_strength | speed | calibration_method |
+----+-----------------+-------+--------------------+
| | 80 | 500.2 | method2 |
+----+-----------------+-------+--------------------+
```

This result should match the output in DuckDB.

### To Reproduce

run datadusion-cli
input
CREATE TABLE droneinfo_test_where (ts timestamp, signal_strength INT, speed FLOAT, calibration_method STRING);

INSERT INTO droneinfo_test_where VALUES(NOW(),80,500.2,'method2');

SELECT * FROM droneinfo_test_where WHERE signal_strength >= 80 AND speed <= 500.2;

### Expected behavior

Same sql excute on duckdb
![image](https://github.com/user-attachments/assets/6e261c3f-2906-476c-a94a-43896555596a)

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the CREATE TABLE, INSERT, and SELECT statements in datadusion-cli and compare the result with DuckDB. Capture the actual error or incorrect output, then trace the filter evaluation for the combined INT and FLOAT predicates until the query returns the inserted row, matching DuckDB.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.