Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12286

NPE in SQLView exporter when filter is null

    XMLWordPrintableJSON

    Details

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

      Description

      When filter is null in SqlViewMetricExporterSpi then NPE happens:

      [2019-10-13 12:30:43,611][INFO ][main][root] >>> Starting test: SqlViewExporterSpiTest#testDataRegionMetrics <<<
      [2019-10-13 12:30:43,616][ERROR][main][root] Test failed.
      class org.apache.ignite.IgniteException: Failed to execute SQL query. Внутренняя ошибка: "java.lang.NullPointerException"
      General error: "java.lang.NullPointerException"; SQL statement:
      SELECT REPLACE(name, 'io.dataregion.default.'), value, description FROM SYS.METRICS [50000-197]
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.lambda$executeSelect0$1(IgniteH2Indexing.java:1422)
      	at org.apache.ignite.internal.processors.cache.QueryCursorImpl.iter(QueryCursorImpl.java:106)
      	at org.apache.ignite.internal.processors.cache.query.RegisteredQueryCursor.iter(RegisteredQueryCursor.java:66)
      	at org.apache.ignite.internal.processors.cache.QueryCursorImpl.getAll(QueryCursorImpl.java:125)
      	at org.apache.ignite.internal.processors.cache.metric.SqlViewExporterSpiTest.execute(SqlViewExporterSpiTest.java:589)
      	at org.apache.ignite.internal.processors.cache.metric.SqlViewExporterSpiTest.testDataRegionMetrics(SqlViewExporterSpiTest.java:136)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [2019-10-13 12:30:43,619][INFO ][main][root] >>> Stopping test: SqlViewExporterSpiTest#testDataRegionMetrics in 8 ms <<<
      	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:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.apache.ignite.testframework.junits.GridAbstractTest$7.run(GridAbstractTest.java:2090)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: class org.apache.ignite.IgniteCheckedException: Failed to execute SQL query. Внутренняя ошибка: "java.lang.NullPointerException"
      General error: "java.lang.NullPointerException"; SQL statement:
      SELECT REPLACE(name, 'io.dataregion.default.'), value, description FROM SYS.METRICS [50000-197]
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:828)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:909)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$2.iterator(IgniteH2Indexing.java:578)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$2.iterator(IgniteH2Indexing.java:555)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.lambda$executeSelect0$1(IgniteH2Indexing.java:1419)
      	... 15 more
      Caused by: org.h2.jdbc.JdbcSQLException: Внутренняя ошибка: "java.lang.NullPointerException"
      General error: "java.lang.NullPointerException"; SQL statement:
      SELECT REPLACE(name, 'io.dataregion.default.'), value, description FROM SYS.METRICS [50000-197]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
      	at org.h2.message.DbException.get(DbException.java:168)
      	at org.h2.message.DbException.convert(DbException.java:307)
      	at org.h2.command.Command.executeQuery(Command.java:216)
      	at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:114)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:821)
      	... 19 more
      Caused by: java.lang.NullPointerException
      	at org.apache.ignite.spi.metric.sql.MetricRegistryLocalSystemView$1.advance(MetricRegistryLocalSystemView.java:75)
      	at org.apache.ignite.spi.metric.sql.MetricRegistryLocalSystemView$1.hasNext(MetricRegistryLocalSystemView.java:92)
      	at org.apache.ignite.internal.processors.query.h2.opt.GridH2Cursor.next(GridH2Cursor.java:78)
      	at org.h2.index.IndexCursor.next(IndexCursor.java:316)
      	at org.h2.table.TableFilter.next(TableFilter.java:502)
      	at org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1452)
      	at org.h2.result.LazyResult.hasNext(LazyResult.java:79)
      	at org.h2.result.LazyResult.next(LazyResult.java:59)
      	at org.h2.command.dml.Select.queryFlat(Select.java:527)
      	at org.h2.command.dml.Select.queryWithoutCache(Select.java:633)
      	at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:114)
      	at org.h2.command.dml.Query.query(Query.java:352)
      	at org.h2.command.dml.Query.query(Query.java:333)
      	at org.h2.command.CommandContainer.query(CommandContainer.java:114)
      	at org.h2.command.Command.executeQuery(Command.java:202)
      	... 21 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nizhikov Nikolay Izhikov
                Reporter:
                nizhikov Nikolay Izhikov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m