Can JSON values synchronized to TiFlash be analyzed?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: json值同步到TiFlash可以做分析吗?

| username: emerson_cai

A table has a field that is a JSON string, and now I want to analyze the data within that string. Can it be synchronized to TiFlash to solve this?

| username: zhanggame1 | Original post link

Impossible.

| username: 有猫万事足 | Original post link

I’m not sure what analysis you want to do, but it is certain that TiFlash supports only a few JSON functions for pushdown.

JSON functions: JSON_LENGTH(), ->, ->>, JSON_EXTRACT()

Moreover, there are many other methods to handle JSON.
For example:

and

| username: cassblanca | Original post link

Synchronizing JSON to TiFlash is definitely not a problem, but TiFlash uses an MPP architecture and columnar storage, which is more suitable for aggregation and statistical analysis. Currently, the JSON data type is relatively complex and may not be well compressed to achieve acceleration. Generally speaking, semi-structured JSON text content is more conveniently handled using NoSQL or ES full-text search.

| username: redgame | Original post link

It won’t work if you do it directly.

| username: TiDBer_oHSwKxOH | Original post link

You can sync the JSON to other tables and then analyze it.

| username: tidb菜鸟一只 | Original post link

Your example should only use multi-valued indexes because: 1. There are very few JSON functions pushed down to TiFlash, which do not support your requirements. 2. Generated columns do not support adding via ALTER TABLE, and your table already exists. However, multi-valued indexes also have some limitations.

It is recommended to create test data and test it to see the effect.

| username: Fly-bird | Original post link

It seems not possible, try a different approach.