Connect Redash and save analytic queries¶
Start with the shared setup and dataset. The versioned observations below use the MatrixOne build identified in the overview.
Configure and query¶
Install Redash and initialize its application database/workers following upstream deployment instructions. The tested native MySQL runner was from Redash 26.9.0, bundled with mysqlclient 2.1.1.
Add a MySQL datasource in datasource settings. Set host
MO_HOST, port6001, databasebi_tutorial, username and password. Match SSL options to your instance.Check the connection with
SELECT 1, then create a query using the shared total SQL. The runner’s internal configuration keys arehost,port,user,passwd,dbanduse_ssl; do not mistake these for the visible field labels.Save the category query as
Net amount by category. After executing it, checkA=130.000000andB=280.000000in the table.In a deployed UI, a bar visualization uses
categoryas its grouping column andnet_amountas the value. Add the saved visualization to a dashboard only after checking the returned data. UI visualization, scheduled refresh and dashboard behavior need their own validation.
Decimal precision and version differences¶
The current runner connected and returned correct native Decimal results. Redash’s production JSON encoder converts Decimal values to float, so large/high-precision amounts can lose precision after the database query. Run the shared large-Decimal check and inspect serialized/exported results before relying on financial values. Correct native query values do not establish exact browser arithmetic.
An older Redash 10.1.0 / mysqlclient 1.4.6 combination failed authentication on the same MatrixOne binary. The working newer runner is not evidence that an engine fix resolved that older failure; see #29957.
Validation covered the native query runner and the actual JSON serialization path, not a full Redash web deployment, scheduler or browser dashboard. See the shared metric definitions to avoid adding overlapping distinct counts or averaging row-level ratios.