BlazingDB / blazingsql

BlazingSQL is a lightweight, GPU accelerated, SQL engine for Python. Built on RAPIDS cuDF.
https://blazingsql.com
Apache License 2.0
1.93k stars 183 forks source link

[BUG] FOLLOWING keyword throws stoi #1458

Closed drabastomek closed 3 years ago

drabastomek commented 3 years ago

Describe the bug Using the FOLLOWING keyword in window functions throws stoi error.

Steps/Code to reproduce bug

import blazingsql as bsql
import cudf

df = cudf.DataFrame({
    'np_int8': np.int8(np.arange(-5, 6))
    , 'category': ['A', 'A', 'A'
    , 'B', 'B', 'B'
    , 'C', 'C', 'C'
    , 'D', None]
})
bc = bsql.BlazingContext()
bc.create_table('df_table', df)

bc.sql('''
    SELECT category, SUM(np_int8) OVER (PARTITION BY category ORDER BY np_int8 NULLS FIRST ROWS 2 FOLLOWING)
    FROM df_table
    ORDER BY category DESC
''')

The PRECEDING keyword works as intended.

Expected behavior Not throw an error and produce proper result.

Environment overview (please complete the following information)

drabastomek commented 3 years ago

cc: @williamBlazing