# QuestDB 8.1.2 - Unexpected filter error

**URL:** https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226
**Category:** Community
**Tags:** bug
**Created:** [November 7, 2024, 10:11am UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226 "2024-11-07T10:11:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mat](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/mat/32/123_2.png) [@Mat](https://community.questdb.com/u/Mat)
#### Post date: [November 7, 2024, 10:11am UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226/1 "2024-11-07T10:11:05Z")

</div>

Hi everyone !

I’m having an issue when querying our QuestDB (8.1.2)  
A simple query that worked perfectly a few days ago now randomly started crashing and I don’t seem to understand why.  
I’m not quite certain but I haven’t found any similar issues on the forum.

Thanks for your help in advance !

 ![image](https://canada1.discourse-cdn.com/flex004/uploads/questdb/original/1X/f9d5e563fdca7ef0eb3cb2cb91ba58f86c90d22e.png)

---

<div class="post-metadata">

### Author: ![bluestreak01](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/bluestreak01/32/17_2.png) [@bluestreak01](https://community.questdb.com/u/bluestreak01)
#### Post date: [November 7, 2024, 10:14am UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226/2 "2024-11-07T10:14:33Z")

</div>

Hi Mat, do you mind trying to upgrade to the latest version? 8.1.4?

---

<div class="post-metadata">

### Author: ![Mat](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/mat/32/123_2.png) [@Mat](https://community.questdb.com/u/Mat)
#### Post date: [November 7, 2024, 10:18am UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226/3 "2024-11-07T10:18:49Z")

</div>

Hi !  
I’ll see if we can upgrade, it’s not on my side but it shouldn’t be to hard, I’ll keep you updated.

In the meantime, do you have an idea as to why it’s happening ? Just out of curiosity !

---

<div class="post-metadata">

### Author: ![chandler150](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@chandler150](https://community.questdb.com/u/chandler150)
#### Post date: [December 2, 2024, 6:02pm UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226/4 "2024-12-02T18:02:58Z")

</div>

Mat & Blue,

We are running into a very similar issue. We tried upgrading to 8.2.0 and it is still present.

In our case, the same query works fine in the Web console, but is repeatedly failing inside automated jobs.

Any advice for a fix?

---

<div class="post-metadata">

### Author: ![nwoolmer](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/nwoolmer/32/24_2.png) [@nwoolmer](https://community.questdb.com/u/nwoolmer)
#### Post date: [December 2, 2024, 7:29pm UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226/5 "2024-12-02T19:29:46Z")

</div>

H8 @chandler150,

We will need more info to debug this!

- Schema
- Problematic queries
- Platform and hardware
- API - HTTP, PG, web console

---

<div class="post-metadata">

### Author: ![chandler150](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@chandler150](https://community.questdb.com/u/chandler150)
#### Post date: [December 2, 2024, 10:30pm UTC](https://community.questdb.com/t/questdb-8-1-2-unexpected-filter-error/226/6 "2024-12-02T22:30:54Z")

</div>

Hey @nwoolmer ,

Here’s some output from our code:  
Building DataOccupancy table for ASC09L:  
Looking for data available in QuestDB… Found no existing data. Done  
Finding available ‘[’.Parquet’, ‘.parquet’]’ logs… Found 56628. 309 days 16:24:00 with 0 gaps to fill. Done  
Finding available ‘[’.cms’]’ logs… C:\code/PCMC\_LBCT/Python/questdb\QuestdbLink.py:320: UserWarning: Query exception occurred, so returning an empty Dataframe: (psycopg2.DatabaseError) unexpected filter error  
LINE 1:  
^

[SQL:  
SELECT \* FROM LogAttributes  
WHERE Extension in (‘.cms’)  
AND Deleted=False

```
    AND Crane IN ('09L')
    AND ((to_timezone(StartDateTime,'America/Los_Angeles') BETWEEN '2021-08-01T07:00:00.000000Z' AND '2024-12-02T17:35:59.949901Z') 
        OR (to_timezone(EndDateTime,'America/Los_Angeles') BETWEEN '2021-08-01T07:00:00.000000Z' AND '2024-12-02T17:35:59.949901Z'))
    ORDER BY StartDateTime;
]

```

(Background on this error at: [Error Messages — SQLAlchemy 2.0 Documentation](https://sqlalche.me/e/20/4xp6))  
warnings.warn(f"Query exception occurred, so returning an empty Dataframe: {error}")  
Attempted Query: \<  
SELECT \* FROM LogAttributes  
WHERE Extension in (‘.cms’)  
AND Deleted=False

```
    AND Crane IN ('09L')
    AND ((to_timezone(StartDateTime,'America/Los_Angeles') BETWEEN '2021-08-01T07:00:00.000000Z' AND '2024-12-02T17:35:59.949901Z') 
        OR (to_timezone(EndDateTime,'America/Los_Angeles') BETWEEN '2021-08-01T07:00:00.000000Z' AND '2024-12-02T17:35:59.949901Z'))
    ORDER BY StartDateTime;
>

```

Found 0. Traceback (most recent call last):

Here’s the query that works fine in the Web console:

SELECT \* FROM LogAttributes  
WHERE Extension in (‘.cms’)  
AND Deleted=False  
AND Crane IN (‘09L’)  
AND ((to\_timezone(StartDateTime,‘America/Los\_Angeles’) BETWEEN ‘2021-08-01T07:00:00.000000Z’ AND ‘2024-12-02T17:35:59.949901Z’)  
OR (to\_timezone(EndDateTime,‘America/Los\_Angeles’) BETWEEN ‘2021-08-01T07:00:00.000000Z’ AND ‘2024-12-02T17:35:59.949901Z’))  
ORDER BY StartDateTime;

and here it is from the docker logs:  
2024-12-02T17:38:08.705967Z E i.q.g.e.QueryProgress err [id=-1, sql=`WITH one as ( SELECT TransactionTime, Compute, row_number() OVER (PARTITION BY Compute ORDER BY Compute, TransactionTime) as rn FROM DataLineage WHERE OutputTarget = 'Parquet' AND Compute NOT IN ('CMSTest', 'DEVCMS19', 'DEVCMS20', 'DEVCMS21', 'DEVCMS22', 'DEVCMS23', 'DEVCMS24', 'DEVCMS25', 'DEVCMS26') AND TransactionTime BETWEEN '2024-12-02T16:38:08.441Z' AND '2024-12-02T17:38:08.441Z' ), two as (SELECT a.TransactionTime, a.Compute, datediff('s', a.TransactionTime, b.TransactionTime) as CycleTime FROM one a LEFT JOIN one b ON a.Compute = b.Compute AND a.rn = b.rn - 1) SELECT Date_trunc('hour',dateadd('h',1,TransactionTime)) as TransactionTime, (avg(CycleTime))/60 as AvgCycleTime FROM two ORDER BY TransactionTime SAMPLE BY 1h ALIGN TO CALENDAR TIME ZONE 'America/Los_Angeles';`, principal=admin, cache=false, jit=false, time=5713487, msg=unexpected token [SAMPLE], errno=0, pos=794]  
2024-12-02T17:38:19.055408Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=73, frameCount=235]  
2024-12-02T17:38:19.055218Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=74, frameCount=235]  
2024-12-02T17:38:19.055547Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=75, frameCount=235]  
2024-12-02T17:38:19.055585Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=76, frameCount=235]  
2024-12-02T17:38:19.055928Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=77, frameCount=235]  
2024-12-02T17:38:19.056272Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=78, frameCount=235]  
2024-12-02T17:38:19.056312Z E i.q.c.s.a.PageFrameReduceJob reduce error [error=  
java.lang.NullPointerException  
, id=876487, taskType=0, frameIndex=79, frameCount=235]  
2024-12-02T17:38:19.063517Z E i.q.g.e.t.AsyncFilteredRecordCursor filter error [ex=  
io.questdb.cairo.CairoException: [-1] unexpected filter error  
at io.questdb.cairo.CairoException.instance(CairoException.java:316)  
at io.questdb.cairo.CairoException.nonCritical(CairoException.java:121)  
at io.questdb.griffin.engine.table.AsyncFilteredRecordCursor.fetchNextFrame(AsyncFilteredRecordCursor.java:333)  
at io.questdb.griffin.engine.table.AsyncFilteredRecordCursor.hasNext(AsyncFilteredRecordCursor.java:203)  
at io.questdb.griffin.engine.QueryProgress$RegisteredRecordCursor.hasNext(QueryProgress.java:319)  
at io.questdb.cutlass.pgwire.modern.PGPipelineEntry.outCursor(PGPipelineEntry.java:1883)  
at io.questdb.cutlass.pgwire.modern.PGPipelineEntry.outCursor(PGPipelineEntry.java:1854)  
at io.questdb.cutlass.pgwire.modern.PGPipelineEntry.msgSync(PGPipelineEntry.java:680)  
at io.questdb.cutlass.pgwire.modern.PGConnectionContextModern.syncPipeline(PGConnectionContextModern.java:1312)  
at io.questdb.cutlass.pgwire.modern.PGConnectionContextModern.msgSync0(PGConnectionContextModern.java:1142)  
at io.questdb.cutlass.pgwire.modern.PGConnectionContextModern.msgSync(PGConnectionContextModern.java:1138)  
at io.questdb.cutlass.pgwire.modern.PGConnectionContextModern.msgQuery(PGConnectionContextModern.java:1111)  
at io.questdb.cutlass.pgwire.modern.PGConnectionContextModern.parseMessage(PGConnectionContextModern.java:1239)  
at io.questdb.cutlass.pgwire.modern.PGConnectionContextModern.handleClientOperation(PGConnectionContextModern.java:450)  
at io.questdb.cutlass.pgwire.modern.PGWireServerModern$1.lambda$$0(PGWireServerModern.java:111)  
at io.questdb.network.AbstractIODispatcher.processIOQueue(AbstractIODispatcher.java:199)  
at io.questdb.cutlass.pgwire.modern.PGWireServerModern$1.run(PGWireServerModern.java:141)  
at io.questdb.mp.Worker.run(Worker.java:152)  
]  
2024-12-02T17:38:19.075939Z E i.q.g.e.QueryProgress err [id=6556152, sql=`SELECT \* FROM LogAttributes  
WHERE Extension in (‘.cms’)  
AND Deleted=False

```
    AND Crane IN ('09L')
    AND ((to_timezone(StartDateTime,'America/Los_Angeles') BETWEEN '2021-08-01T07:00:00.000000Z' AND '2024-12-02T17:35:59.949901Z')

```

OR (to\_timezone(EndDateTime,‘America/Los\_Angeles’) BETWEEN ‘2021-08-01T07:00:00.000000Z’ AND ‘2024-12-02T17:35:59.949901Z’))  
ORDER BY StartDateTime;`, principal=admin, cache=false, jit=false, time=1007026188, msg=unexpected filter error, errno=-1, pos=0]
