Convert ID Integer columns to strings (#13107)
* Convert ID Integer columns to strings Converts any ID (PK or FK) column that's derived from a :type/Integer to a string in query middleware (at the end of query processing.) JavaScript treats all numbers as floats, with a 52 bit mantissa. Any integer larger than 52 bits ends up looking like a strange floating point number. This will allow the UI to properly display a number n where n > 2^52 or n < -2^52 Resolves #5816 [ci all] * code review feedback * skip the reduce phase if there are no columns to update * handle joins properly joins have two :field-id values in them. handle them appropriately * update cloverage build * update tools.namespace for newer cloverage * handle all query types more gracefully Only in cases where we have an explicit :field-id do we try to do the coercions to strings. It's important to not filter the :fields clause in such a way that anything is left out - if they were, the keep-indexed call would modify the wrong values in the result.
Showing
- project.clj 3 additions, 3 deletionsproject.clj
- src/metabase/api/card.clj 3 additions, 2 deletionssrc/metabase/api/card.clj
- src/metabase/api/dataset.clj 2 additions, 1 deletionsrc/metabase/api/dataset.clj
- src/metabase/query_processor.clj 2 additions, 0 deletionssrc/metabase/query_processor.clj
- src/metabase/query_processor/middleware/large_int_id.clj 48 additions, 0 deletionssrc/metabase/query_processor/middleware/large_int_id.clj
- test/metabase/api/dataset_test.clj 2 additions, 1 deletiontest/metabase/api/dataset_test.clj
- test/metabase/query_processor/middleware/large_int_id_test.clj 97 additions, 0 deletions...metabase/query_processor/middleware/large_int_id_test.clj
Please register or sign in to comment