justinpark commented on code in PR #23378:
URL: https://github.com/apache/superset/pull/23378#discussion_r1145446083


##########
superset-frontend/src/SqlLab/actions/sqlLab.js:
##########
@@ -331,6 +331,12 @@ export function fetchQueryResults(query, displayLimit) {
   };
 }
 
+export function cleanSqlComments(sql) {
+  if (!sql) return '';
+
+  return sql.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)|(--[^.].*)/gm, '').trim();

Review Comment:
   It should be okay at least superset UI visualizes the `select *` block as 
commented out for other comment-out styles. (so the user expected that can be 
ignored)
   
   i.e.
   <img width="538" alt="Screenshot 2023-03-22 at 2 49 39 PM" 
src="https://user-images.githubusercontent.com/1392866/227046753-efd8694e-3389-42ab-8e46-61416cb3a0e5.png";>
   



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