I'm trying to parse a PostgreSQL metadata query but a parsing exception is
thrown.

Here is my code:

Config parserConfig =
configBuilder().setConformance(SqlConformanceEnum.BABEL).build();
FrameworkConfig frameworkConfig =
Frameworks.newConfigBuilder().parserConfig(parserConfig).build();
Planner planner = Frameworks.getPlanner(frameworkConfig);
planner.parse("SELECT typinput='array_in'::regproc, typtype FROM
pg_catalog.pg_type LEFT JOIN (select ns.oid as nspoid, ns.nspname, r.r from
pg_namespace as ns join ( select s.r, (current_schemas(false))[s.r] as
nspname from generate_series(1, array_upper(current_schemas(false), 1)) as
s(r) ) as r using ( nspname )) as sp ON sp.nspoid = typnamespace WHERE
typname = $1 ORDER BY sp.r, pg_type.oid DESC LIMIT 1");

*The exception title is* "Exception in thread "main"
org.apache.calcite.sql.parser.SqlParseException: Encountered ":" at line 1,
column 27."

Am I doing something wrong or is the parser still not ready for such syntax
?

Thanks,
Gelbana

Reply via email to