lyft / presto-gateway

A load balancer / proxy / gateway for prestodb
Apache License 2.0
358 stars 156 forks source link

Missing null query check in query response #137

Open amitds1997 opened 3 years ago

amitds1997 commented 3 years ago

For an incompatible client, Trino/Presto throw exception :

Basic authentication or X-Trino-User must be sent // Trino
Basic authentication or X-Presto-User must be sent // Presto

and sends no Query Id information.

We are currently submitting the query for addition to Query History without checking if the Query Id is null.

https://github.com/lyft/presto-gateway/blob/39d7d5f3194265c688d4d5f01db1d64143fe284a/gateway-ha/src/main/java/com/lyft/data/gateway/ha/handler/QueryIdCachingProxyHandler.java#L258

which leads to an Exception

java.sql.SQLException: Field 'query_id' doesn't have a default value
endoplasmicR commented 3 years ago

this is likely something https://trino.io/blog/2021/01/04/migrating-from-prestosql-to-trino.html has described and you need to enable "Client protocol compatiblity" on the trino coordinator

endoplasmicR commented 2 years ago

We may consider adding dual HTTP header writes (if eitherX-Presto-... or X-Trino-... is set, both X-Presto-... and X-Trino-...` headers would be send to the coordinators) in the future