bellwether-softworks opened a new issue, #5229:
URL: https://github.com/apache/arrow-datafusion/issues/5229
**Describe the bug**
I'm attempting to use the `ROW_NUMBER()` function, and encountering the
following error:
> Arrow error: External error: Arrow error: Invalid argument error:
batches[2] schema is different with argument schema.
The query in question:
```sql
SELECT ROW_NUMBER() OVER (PARTITION BY part_id ORDER BY range_begin) AS
rownum
FROM __temp_inverted_ranges_phase_1
```
The error no longer occurs if the `PARTITION BY` clause is omitted.
**Expected behavior**
Successfully executed `ROW_NUMBER` function, or meaningful explanation of
the schema failure.
**Additional context**
The table in question is the result from a preceding query; when attempting
to perform a similar ROW_NUMBER invocation against that data, no errors occur.
When viewing the schema for the data backing the failing query:
```
+-------------+-----------+-------------+---------------+--------------------------------+--------------+
| column_name | data_type | is_nullable | table_catalog | table_name
| table_schema |
+-------------+-----------+-------------+---------------+--------------------------------+--------------+
| part_id | Int32 | NO | datafusion |
__temp_inverted_ranges_phase_1 | public |
+-------------+-----------+-------------+---------------+--------------------------------+--------------+
| range_begin | Float32 | YES | datafusion |
__temp_inverted_ranges_phase_1 | public |
+-------------+-----------+-------------+---------------+--------------------------------+--------------+
| range_end | Float32 | YES | datafusion |
__temp_inverted_ranges_phase_1 | public |
+-------------+-----------+-------------+---------------+--------------------------------+--------------+
```
An illustrative dataset is as shown below:
```
+---------+-------------+-----------+
| part_id | range_begin | range_end |
+---------+-------------+-----------+
| 221770 | 30.03167 | 128.24088 |
+---------+-------------+-----------+
| 221842 | 67.875 | 64.375 |
+---------+-------------+-----------+
| 221883 | 107.25 | 107.25 |
+---------+-------------+-----------+
| 221883 | 133.875 | 112.96875 |
+---------+-------------+-----------+
| 221969 | 22.21875 | 0.0 |
+---------+-------------+-----------+
| 221979 | 75.46887 | 75.46887 |
+---------+-------------+-----------+
| 221988 | 15.96875 | 25.84375 |
+---------+-------------+-----------+
| 221988 | 47.96875 | 50.96875 |
+---------+-------------+-----------+
| 222006 | 68.71875 | 68.71875 |
+---------+-------------+-----------+
| 222013 | 32.71875 | 38.625004 |
+---------+-------------+-----------+
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]