Hi guys,
Have some strange error when I tried to execute the next SELECT query:
SELECT count(a.id) count_yes, a.stepid stepid_yes, a.stepid
FROM activity a
WHERE
a.type = 4
AND
a.stepid IN ('1bb64fbb-8d46-4eb5-ab6e-7c0aab679ea7')
GROUP BY a.stepid
Error:
SQLActionException[SQLParseException: Couldn't find Field{QueriedTable{DocTableRelation{doc.activity}}.stepid_yes, pointer=Reference{ident=<RefIdent: doc.activity->stepid>, granularity=DOC, position=6, default expression=null, type=text, index type=NOT_ANALYZED, nullable=true, columnstore enabled=false}} in SourceSymbols{inputs={Field{QueriedTable{DocTableRelation{doc.activity}}.count_yes, pointer=count(Ref{doc.activity.id, text})}=IC{0, bigint}, Field{QueriedTable{DocTableRelation{doc.activity}}.stepid, pointer=Reference{ident=<RefIdent: doc.activity->stepid>, granularity=DOC, position=6, default expression=null, type=text, index type=NOT_ANALYZED, nullable=true, columnstore enabled=false}}=IC{2, text}}, nonDeterministicFunctions={}}]
Looks like parser detects alias as some table column.
Please note that this works differently on different machines. This query is executed well on the server with Linux but on my local computer with Windows I get this error.
CrateDB version: 4.0.2 -SNAPSHOT-27add9a
My docker-compose config:
crate:
image: crate
container_name: ezf_crate
ports:
- "4200:4200"
- "5432:5432"
expose:
- 5432
volumes:
- ./cratedb/runtime/data:/data
environment:
CRATE_HEAP_SIZE: 1g
command: crate -Cnode.name=crate-1 -Cnode.store.allow_mmapfs=false