Actually, `SqlParser.Config.DEFAULT.withConformance(SqlConformanceEnum.BIG_QUERY)` helped, thanks ! I will try to understand why it doesn't work with BABEL conformance
On Fri, Feb 4, 2022 at 2:35 PM Dmitry Sysolyatin <[email protected]> wrote: > How SqlParser config can help? If I understood correctly, parser config > affects only parser.parse stage. But code fails at the validation phase > > Also, I would like to use ARRAY_CONCAT function with postgres dialect. My > parser config at the moment: > > ``` > val parserConfig: SqlParser.Config = > PostgresqlSqlDialect.DEFAULT > .configureParser(SqlParser > .config() > // It is needed in order to parse PG "!~" operator > .withParserFactory(SqlBabelParserImpl.FACTORY) > ) > .withConformance(SqlConformanceEnum.BABEL) > ``` > > On Fri, Feb 4, 2022 at 2:26 PM Thomas Rebele <[email protected]> > wrote: > >> Hello, >> >> SqlParserTest might help you. It has some checks related to BIG_QUERY. >> Maybe a >> >> .parserConfig(SqlParser.Config.DEFAULT.withConformance(SqlConformanceEnum.BIG_QUERY)) >> could fix the problem. >> >> Cordialement / Best Regards, >> *Thomas Rebele, PhD* | R&D Developer | Germany | www.tibco.com >> >> >> On Fri, Feb 4, 2022 at 12:57 PM Dmitry Sysolyatin < >> [email protected]> >> wrote: >> >> > Hi! >> > I have a problem with ARRAY_CONCAT operator. >> > >> > The following code failed with the exception ''No match found for >> function >> > signature array_concat(<INTEGER ARRAY>, <INTEGER ARRAY>)". >> > ``` >> > val config = Frameworks.newConfigBuilder() >> > .parserConfig(parserConfig) >> > .defaultSchema(CalciteSchema.createRootSchema(false, false).plus()) >> > .operatorTable(SqlOperatorTables.chain( >> > SqlStdOperatorTable.instance(), >> > SqlLibraryOperatorTableFactory.INSTANCE.getOperatorTable( >> > SqlLibrary.BIG_QUERY >> > ))) >> > .programs(Programs.standard()) >> > .build() >> > val planner = Frameworks.getPlanner(config) >> > >> > val query = "SELECT ARRAY_CONCAT(ARRAY[1, 2], ARRAY[2, 3])" >> > val parsedSqlNode = planner.parse(query) >> > planner.validate(parsedSqlNode) >> > ``` >> > >> > Am I doing something wrong or it is a bug? >> > >> >
