leoguo1024 commented on issue #28596:
URL: https://github.com/apache/superset/issues/28596#issuecomment-2175484127

   I encountered the same problem and tried to print some logs to investigate 
the issue. The code is as follows:
   superset/sql_parse.py
   class ParsedQuery:
       def __init__(
           self,
           sql_statement: str,
           strip_comments: bool = False,
           engine: str | None = None,
       ):
           if strip_comments:
               sql_statement = sqlparse.format(sql_statement, 
strip_comments=True)
   
           self.sql: str = sql_statement
           self._dialect = SQLGLOT_DIALECTS.get(engine) if engine else None
           self._tables: set[Table] = set()
           self._alias_names: set[str] = set()
           self._limit: int | None = None
   
           logger.debug("Parsing with sqlparse statement: %s", self.sql)
           self._parsed = sqlparse.parse(self.stripped())
           for statement in self._parsed:
               self._limit = _extract_limit_from_query(statement)
   
   def stripped(self) -> str:
           return self.sql.strip(" \t\r\n;") 
   I try to  print log:
   logger-info (self.sql)
   The output is
   Template (body=[Output (nodes=[TemplateData (data='SELECT * from xxxx. xxxx 
limit 100; ')])
   The code will not continue to execute until this point
   return self.sql.strip(" \t\r\n;") 


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