zhaoyongjie commented on code in PR #24241:
URL: https://github.com/apache/superset/pull/24241#discussion_r1209397283


##########
superset/db_engine_specs/base.py:
##########
@@ -737,7 +741,27 @@ def fetch_data(
         try:
             if cls.limit_method == LimitMethod.FETCH_MANY and limit:
                 return cursor.fetchmany(limit)
-            return cursor.fetchall()
+            data = cursor.fetchall()
+            description = cursor.description or []
+            column_type_mutators = {
+                row[0]: func
+                for row in description
+                if (
+                    func := cls.column_type_mutators.get(
+                        
type(cls.get_sqla_column_type(cls.get_datatype(row[1])))
+                    )
+                )
+            }
+            if column_type_mutators:

Review Comment:
   Typically decimal is a fixed point data structure but native `float` in 
Python is not fixed point data, so some drivers return a string to represent 
fixed point. `column_type_mutators` adds some extra transformation on the 
decimal column so the query performance might become lower than before.
   
   From the screenshot before and after, I saw the `coltypes` field changed 
from `1` -> `0`, do we have some other approach just change the `coltypes` 
instead to mutate entire values of column?



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