Files
doris/fe/fe-core/src
ElvinWei e1d2f82d8e [feature](statistics) template for building internal query SQL statements (#12714)
Template for building internal query SQL statements,it mainly used for statistics module. After the template is defined, the executable statement will be built after the given parameters.

For example, template and parameters:
- template: `SELECT ${col} FROM ${table} WHERE id = ${id};`,
- parameters:  `{col=colName, table=tableName, id=1}`
- result sql:  `SELECT colName FROM tableName WHERE id = 1;`

usage:
```
String template = "SELECT * FROM ${table} WHERE id = ${id};";
Map<String, String> params = new HashMap<>();
params.put("table", "table0");
params.put("id", "123");

// result: SELECT * FROM table0 WHERE id = 123;
String result = InternalSqlTemplate.processTemplate(template, params);
```
2022-09-19 22:10:28 +08:00
..