Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6029

SqlOperatorTest cannot test operators that require the Babel parser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Workaround
    • 1.35.0
    • None
    • babel, core

    Description

      In SqlOperatorTest one can write code like this:

      @Test void testDatePart() {
          final SqlOperatorFixture f = fixture().withLibrary(SqlLibrary.POSTGRESQL)
              .withParserConfig(p -> p.withParserFactory(SqlBabelParserImpl.FACTORY));
      

      This almost works, but the SqlOperatorTest.check function makes a connection ignores the parserFactory, so parsing will fail:

          @Override public void check(SqlTestFactory factory, String query,
              SqlTester.TypeChecker typeChecker,
              SqlTester.ParameterChecker parameterChecker,
              SqlTester.ResultChecker resultChecker) {
            super.check(factory, query, typeChecker, parameterChecker, resultChecker);
            final RelDataTypeSystem typeSystem =
                factory.typeSystemTransform.apply(RelDataTypeSystem.DEFAULT);
            final ConnectionFactory connectionFactory =
                factory.connectionFactory
                    .with(CalciteConnectionProperty.TYPE_SYSTEM, uri(FIELD));  /// NO PARSER_FACTORY HERE
      

      I am trying to fix this by adding a PARSER_FACTORY argument to the connection, but then I get a class loader error from AvaticaUtils.instantiatePlugin, which, in this case, cannot find the SqlBabelParserImpl#FACTORY in the classpath.

      I would appreciate some help solving this last bit.

      Attachments

        Issue Links

          Activity

            People

              mbudiu Mihai Budiu
              mbudiu Mihai Budiu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: