public class Expander extends Object
Simple use:
final String sql =
"select ename from emp where deptno < 10";
final Expander.Expanded expanded =
Expander.create(planner).expanded(sql);
print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` < 10"
Calling Expander.Expanded.toString()
generates a string that is similar to SQL where a user has
manually converted all identifiers as expanded, and which could then be persisted as expanded
query of a Catalog view.
For more advanced formatting, use Expander.Expanded.substitute(Function)
.
Adjust SqlParser.Config
to use a different parser or parsing options.
Modifier and Type | Class and Description |
---|---|
static class |
Expander.Expanded
Result of expanding.
|
Modifier and Type | Method and Description |
---|---|
static Expander |
create(org.apache.flink.table.planner.calcite.FlinkPlannerImpl planner)
Creates an Expander.
|
Expander.Expanded |
expanded(String ori)
Expands identifiers in a given SQL string, returning a
Expander.Expanded . |
public static Expander create(org.apache.flink.table.planner.calcite.FlinkPlannerImpl planner)
public Expander.Expanded expanded(String ori)
Expander.Expanded
.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.