Fix BQ Dataset Explorer returning empty results#372
Open
szmikler wants to merge 2 commits intoGoogleCloudDataproc:mainfrom
Open
Fix BQ Dataset Explorer returning empty results#372szmikler wants to merge 2 commits intoGoogleCloudDataproc:mainfrom
szmikler wants to merge 2 commits intoGoogleCloudDataproc:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem:
When using the search field in the BigQuery Dataset Explorer, searches for private datasets (user projects) were returning empty results locally, even when the datasets clearly existed. However, searches for public datasets were working as expected.
Cause:
The frontend was sending the search
typeparameter wrapped in parentheses:type=(table|dataset). When the backend transformed this into a Dataplex search query, it generated a malformed string like(type=TABLE OR type=DATASET). While the Dataplex API is lenient with public data, it is strictly sensitive to this syntax for private project entries, causing it to return zero results.Solution:
Removed the redundant parentheses from the
typeparameter in therequestAPIcall withinbigQueryService.tsx. The parameter is now sent astype=table|dataset, allowing the backend to correctly construct the Dataplex search query.Verification:
curlthat removing parentheses from the search query returns the expected private datasets.To reproduce the issue and verify the fix, you can use the following
curlcommands. These simulate how the backend's search query behaves when it receives the parameter with or without parentheses.Local Reproduction
Prerequisites
Ensure you have an active access token and your project ID set:
To reproduce the issue exactly as it happens in the backend, we need to use the specific query string that the plugin's Python code generates when it receives the malformed input from the frontend.
The backend splits the input by
|and prependstype=. When it receives(table|dataset), it produces this broken query:(type=(TABLE OR type=DATASET)).Prerequisites
1. Reproduce the Problem (Generation of Malformed Query)
This command uses the query string exactly as the current
origin/mainbackend generates it. Notice the nested and mismatched parentheses(type=(TABLE ...)). This should return{}or no results for your private datasets.2. Verify the Fix (Generation of Correct Query)
This command uses the query string generated when the frontend is fixed to send
table|dataset. The backend then correctly generates(type=TABLE OR type=DATASET). This should successfully return your private datasets.Why the difference?
In the first case, the backend's simple string manipulation turns
(table|dataset)into(type=(TABLE OR type=DATASET)). Dataplex treats the literal(at the start of(TABLEas part of the search token rather than a grouping operator, causing the match to fail for private datasets which require precise indexing. Removing the parentheses in the frontend ensures the backend constructs a valid logicalORgroup.