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

Deprecate class RelDataTypeFactory.FieldInfoBuilder

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:
      None

      Description

      Since interface RelDataTypeFactory.FieldInfo is deprecated, and RelDataTypeFactory.FieldInfoBuilder implements it, we should also deprecate FieldInfoBuilder.

      We will create a new class RelDataTypeFactory.Builder that does the same as FieldInfoBuilder without implementing the FieldInfo interface.

      For backwards compatibility, RelDataTypeFactory.builder() will continue to return FieldInfoBuilder but we recommend that you assign the result to a variable of type Builder. Thus you won't be using the deprecated class in your code.

        Issue Links

          Activity

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/a98b21ea .
          Hide
          julianhyde Julian Hyde added a comment -
          Show
          julianhyde Julian Hyde added a comment - And a further fix in http://git-wip-us.apache.org/repos/asf/calcite/commit/c2d3885 .
          Hide
          michaelmior Michael Mior added a comment -

          This seems to be causing a failure in the Cassandra integration tests. I get the following stack trace:

          testMaterializedView(org.apache.calcite.test.CassandraAdapterIT)  Time elapsed: 0.605 sec  <<< ERROR!
          java.lang.NoClassDefFoundError: org/apache/calcite/rel/type/RelDataTypeFactory$Builder
                  at org.apache.calcite.adapter.cassandra.CassandraSchemaFactory.create(CassandraSchemaFactory.java:40)
                  at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:214)
                  at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45)
                  at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:143)
                  at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:85)
                  at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104)
                  at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:139)
                  at java.sql.DriverManager.getConnection(DriverManager.java:664)
                  at java.sql.DriverManager.getConnection(DriverManager.java:208)
                  at org.apache.calcite.test.CalciteAssert$MapConnectionFactory.createConnection(CalciteAssert.java:1156)
                  at org.apache.calcite.test.CalciteAssert$AssertQuery.createConnection(CalciteAssert.java:1195)
                  at org.apache.calcite.test.CalciteAssert$AssertQuery.returns(CalciteAssert.java:1266)
                  at org.apache.calcite.test.CalciteAssert$AssertQuery.explainMatches(CalciteAssert.java:1356)
                  at org.apache.calcite.test.CalciteAssert$AssertQuery.explainContains(CalciteAssert.java:1351)
                  at org.apache.calcite.test.CassandraAdapterIT.testMaterializedView(CassandraAdapterIT.java:167)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:498)
                  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
                  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
                  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
                  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
                  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
                  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                  at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                  at java.lang.Thread.run(Thread.java:748)
          Caused by: java.lang.ClassNotFoundException: org.apache.calcite.rel.type.RelDataTypeFactory$Builder
                  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
                  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
                  ... 33 more
          
          Show
          michaelmior Michael Mior added a comment - This seems to be causing a failure in the Cassandra integration tests. I get the following stack trace: testMaterializedView(org.apache.calcite.test.CassandraAdapterIT) Time elapsed: 0.605 sec <<< ERROR! java.lang.NoClassDefFoundError: org/apache/calcite/rel/type/RelDataTypeFactory$Builder at org.apache.calcite.adapter.cassandra.CassandraSchemaFactory.create(CassandraSchemaFactory.java:40) at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:214) at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45) at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:143) at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:85) at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104) at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:139) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at org.apache.calcite.test.CalciteAssert$MapConnectionFactory.createConnection(CalciteAssert.java:1156) at org.apache.calcite.test.CalciteAssert$AssertQuery.createConnection(CalciteAssert.java:1195) at org.apache.calcite.test.CalciteAssert$AssertQuery.returns(CalciteAssert.java:1266) at org.apache.calcite.test.CalciteAssert$AssertQuery.explainMatches(CalciteAssert.java:1356) at org.apache.calcite.test.CalciteAssert$AssertQuery.explainContains(CalciteAssert.java:1351) at org.apache.calcite.test.CassandraAdapterIT.testMaterializedView(CassandraAdapterIT.java:167) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: org.apache.calcite.rel.type.RelDataTypeFactory$Builder at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 33 more
          Hide
          julianhyde Julian Hyde added a comment -

          That's strange. It's not a binary compatibility issue, because RelDataTypeFactory.Builder did not exist as of last release. But if Builder is not found, how did the code even compile? Can you please try "mvn clean"?

          Show
          julianhyde Julian Hyde added a comment - That's strange. It's not a binary compatibility issue, because RelDataTypeFactory.Builder did not exist as of last release. But if Builder is not found, how did the code even compile? Can you please try "mvn clean"?
          Hide
          michaelmior Michael Mior added a comment -

          Unfortunately the error message above was from a clean build. Just to ensure this is the issue, I ran the tests before this change was merged and they pass.

          Show
          michaelmior Michael Mior added a comment - Unfortunately the error message above was from a clean build. Just to ensure this is the issue, I ran the tests before this change was merged and they pass.

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development