devsarthak2005 opened a new pull request, #41851:
URL: https://github.com/apache/superset/pull/41851

   ## Description
   
   This PR fixes an issue where native UUID columns incorrectly appear in the 
**Search By** dropdown when **Server Pagination** is enabled in the legacy 
Table chart.
   
   The server-side search feature generates `ILIKE` queries, which are only 
valid for text columns. Since UUID columns were being treated as generic 
strings, they were included in the searchable columns list, resulting in 
invalid SQL queries on databases such as PostgreSQL and ClickHouse.
   
   Example of the generated query:
   
   ```sql
   WHERE event_id ILIKE 'eae8b2f8%'
   ```
   
   This fails because native UUID columns do not support `ILIKE`.
   
   ## Root Cause
   
   The table chart determined searchable columns based solely on `sortType === 
"alphanumeric"`. Since UUID columns were mapped to `GenericDataType.String`, 
they also received the `alphanumeric` sort type and were incorrectly exposed in 
the **Search By** dropdown.
   
   Additionally, the native database column type was not propagated through the 
table chart metadata, preventing the frontend from distinguishing UUID columns 
from regular string columns.
   
   ## Solution
   
   This PR:
   
   - Propagates the native database column `type` through the table chart 
metadata.
   - Introduces a helper to identify native UUID column types.
   - Excludes UUID columns from the **Search By** dropdown while preserving 
existing behavior for regular string columns.
   - Keeps sorting behavior unchanged.
   - Adds a React component test covering the new behavior.
   
   ## Before
   
   - UUID columns appeared in the **Search By** dropdown.
   - Selecting a UUID column generated invalid `ILIKE` queries.
   - PostgreSQL and ClickHouse returned database errors.
   
   ## After
   
   - UUID columns are excluded from the **Search By** dropdown.
   - Regular string columns remain searchable.
   - Sorting behavior is unchanged.
   - No backend query generation logic is modified.
   
   ## Testing
   
   Added a React component test verifying that:
   
   - Regular string columns are included in the **Search By** dropdown.
   - UUID columns are excluded.
   - Existing search behavior for string columns remains unchanged.


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