Vladimir Sitnikov created CALCITE-4824:
------------------------------------------

             Summary: ServerUnParserTest#testCreateTableVirtualColumn fails 
                 Key: CALCITE-4824
                 URL: https://issues.apache.org/jira/browse/CALCITE-4824
             Project: Calcite
          Issue Type: Improvement
          Components: server
            Reporter: Vladimir Sitnikov


It looks like {{org.apache.calcite.server.ServerDdlExecutor#INSTANCE}} results 
in non-synchronized HashMap instances in ReflectUtil.

Sample failure:

{noformat}
ServerUnParserTest > testCreateTableVirtualColumn() STANDARD_ERROR
    log4j:WARN No appenders could be found for logger 
(org.apache.calcite.sql.parser).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for 
more info.
WARNING   2.8sec,  442 completed,   0 failed,   5 skipped, 
org.apache.calcite.test.ServerParserTest
WARNING   3.8sec,  442 completed,   0 failed,   6 skipped, 
org.apache.calcite.test.ServerUnParserTest
          2.2sec, org.apache.calcite.test.ServerTest > testVirtualColumn()
org.apache.calcite.test.ServerQuidemTest > test(String)[3], [3] sql\table.iq 
failure marker
FAILURE   3.6sec, org.apache.calcite.test.ServerQuidemTest > test(String)[3], 
[3] sql\table.iq
    org.opentest4j.AssertionFailedError: Files differ: 
D:\a\calcite\calcite\server\build\resources\test\sql\surefire\sql\table.iq 
D:\a\calcite\calcite\server\build\resources\test\sql\table.iq
    23c23,155
    < (0 rows modified)
    ---
    > java.sql.SQLException: Error while executing SQL "create table t (i int, 
j int not null)": Method not found: execute([class 
org.apache.calcite.sql.SqlNode, interface 
org.apache.calcite.jdbc.CalcitePrepare$Context])
    >   at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
    >   at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
    >   at 
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163)
    >   at 
org.apache.calcite.avatica.AvaticaStatement.executeLargeUpdate(AvaticaStatement.java:246)
    >   at 
org.apache.calcite.avatica.AvaticaStatement.executeUpdate(AvaticaStatement.java:240)
    >   at net.hydromatic.quidem.Quidem.update(Quidem.java:279)
    >   at net.hydromatic.quidem.Quidem.access$2900(Quidem.java:54)
    >   at net.hydromatic.quidem.Quidem$ContextImpl.update(Quidem.java:1752)
    >   at net.hydromatic.quidem.Quidem$UpdateCommand.execute(Quidem.java:1152)
    >   at 
net.hydromatic.quidem.Quidem$CompositeCommand.execute(Quidem.java:1548)
    >   at net.hydromatic.quidem.Quidem.execute(Quidem.java:216)
    >   at org.apache.calcite.test.QuidemTest.checkRun(QuidemTest.java:156)
    >   at 
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    >   at 
org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)
    >   at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
    >   at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    >   at 
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    >   at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    >   at 
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
    > Caused by: java.lang.IllegalArgumentException: Method not found: 
execute([class org.apache.calcite.sql.SqlNode, interface 
org.apache.calcite.jdbc.CalcitePrepare$Context])
    >   at 
org.apache.calcite.util.ReflectUtil$2.lookupMethod(ReflectUtil.java:563)
    >   at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:527)
    >   at 
org.apache.calcite.server.DdlExecutorImpl.executeDdl(DdlExecutorImpl.java:41)
    >   at 
org.apache.calcite.prepare.CalcitePrepareImpl.executeDdl(CalcitePrepareImpl.java:369)
    >   at 
org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:634)
    >   at 
org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513)
    >   at 
org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483)
    >   at 
org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:249)
    >   at 
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
    >   at 
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675)
    >   at 
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
    >   ... 116 more
{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to