Skip to content

Adds a broker endpoint to validate query parsing without further validation/execution#17618

Open
saiswapnilar-stripe wants to merge 1 commit intoapache:masterfrom
saiswapnilar-stripe:saiswapnilar/oss-broker-parse-endpoint
Open

Adds a broker endpoint to validate query parsing without further validation/execution#17618
saiswapnilar-stripe wants to merge 1 commit intoapache:masterfrom
saiswapnilar-stripe:saiswapnilar/oss-broker-parse-endpoint

Conversation

@saiswapnilar-stripe
Copy link

@saiswapnilar-stripe saiswapnilar-stripe commented Feb 2, 2026

Addresses #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/validateSyntax" \ -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/validateSyntax" \ -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/validateSyntax" \ -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 "}

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.18%. Comparing base (36ac509) to head (809114f).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...pinot/broker/api/resources/PinotClientRequest.java 70.37% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #17618   +/-   ##
=========================================
  Coverage     63.18%   63.18%           
  Complexity     1479     1479           
=========================================
  Files          3173     3173           
  Lines        189917   189944   +27     
  Branches      29064    29065    +1     
=========================================
+ Hits         120002   120020   +18     
- Misses        60575    60605   +30     
+ Partials       9340     9319   -21     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.16% <70.37%> (-0.01%) ⬇️
java-21 63.15% <70.37%> (+0.02%) ⬆️
temurin 63.18% <70.37%> (+<0.01%) ⬆️
unittests 63.18% <70.37%> (+<0.01%) ⬆️
unittests1 55.52% <ø> (+0.02%) ⬆️
unittests2 34.05% <70.37%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants