How does TiDB distinguish data from different tables when exporting multiple tables to CSV using Dumpling?

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

Original topic: dumpling多表导出csv时,tidb是如何区分不同的表的数据?

| username: yeminhua

How does TiDB identify data from different tables in the CSV when dumping a batch of daily tables with the same structure?
–filetype csv --output-filename-template ‘dw.DWA_FACT_UNPAY{{.Index}}’ -t 8 --filter “dw.DWA_FACT_UNPAY*”

| username: 随缘天空 | Original post link

The suffixes of the same table should be consecutive identifiers. If they are different tables, they should increment from the beginning. Additionally, you can check whether each CSV file contains metadata information related to the table.

| username: 小龙虾爱大龙虾 | Original post link

If you don’t set the --output-filename-template parameter, it can be distinguished by default. The current setting feels indistinguishable (it might even mess up the exported data). The --output-filename-template parameter supports {{.DB}}, {{.Table}}, and {{.Index}} three parameters, which represent the database name, table name, and chunk ID of the data file respectively. You can set it in the format you want.

| username: 像风一样的男子 | Original post link

The CSV file name contains database and table information.

| username: yeminhua | Original post link

Yes, I didn’t specify the file name correctly.

| username: yeminhua | Original post link

Thank you, it is indeed as you said. I only specified {{.Index}}, which didn’t work, causing the CSV file to be overwritten. The CSV actually only contains the data of the last table.

| username: dba远航 | Original post link

The table structures are the same, but the table names are different. The database import is distinguished by table names.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.