saiswapnilar-stripe opened a new pull request, #17618:
URL: https://github.com/apache/pinot/pull/17618

   Addresses https://github.com/apache/pinot/issues/17615 , adding a broker API 
endpoint that parses a query string only for syntactic validation without 
further processing
   
   ### Testing
   Tested the endpoint by running valid/invalid queries
   
   Valid query: `curl -X POST "localhost:8000/query/sql/validate" \
     -H "Content-Type: application/json" \
     -d '{"sql": "SELECT * FROM meetupRsvp LIMIT 10"}'`
   Result: `{"errorCode":null,"validQuery":true,"errorMessage":null}`
   
   Valid query (non existent table): `curl -X POST 
"localhost:8000/query/sql/validate" \
     -H "Content-Type: application/json" \
     -d '{"sql": "SELECT * FROM xyz LIMIT 10"}'`
   Result: `{"errorCode":null,"validQuery":true,"errorMessage":null}`
   
   Invalid query (reserved keyword): `curl -X POST 
"localhost:8000/query/sql/validate" \
     -H "Content-Type: application/json" \
     -d '{
       "sql": "SELECT select FROM airlineStats a JOIN airports b ON 
a.destAirportCode = b.airportCode"
     }'`
   Result: 
`{"errorCode":"SQL_PARSING","validQuery":false,"errorMessage":"Caught exception 
while parsing query: SELECT select FROM airlineStats a JOIN airports b ON 
a.destAirportCode = b.airportCode: Encountered \"\" at line 1, column 8.\nWas 
expecting one of:\n    "}`


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to