Fix source command detection if we have a field expression before source #10598
+13
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The PPL grammar defines searchCommand as follows
However when we write a query
It gives no result.
The issue lies with us appending source = at the beginning of the query.
Query Being sent:
This treats the second SOURCE as a column name creating failures.
This PR fixes the Source Command detection Logic, expanding the logic to check the first | and check if it contains source = or not.
Issues Resolved
Screenshot
Testing the changes
Before:
https://github.com/user-attachments/assets/0be09f44-b271-4d3b-ba50-32261c2bde80
After:
https://github.com/user-attachments/assets/ccc9ed0a-9467-4be3-958d-81fc65afcb50
Changelog
Check List
yarn test:jest
yarn test:jest_integration