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

Ignite Schema Import has to use full class names in fields map.

    XMLWordPrintableJSON

    Details

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

      Description

      The issue based on the user thread: http://apache-ignite-users.70518.x6.nabble.com/Unexpected-SQL-error-when-running-sql-with-conditions-td3899.html.

      CodeGenerator cuts of "java.lang" package for basic types. As a result SQL cannot understand a type of objects and queries like where id > 100 failed with an exception like below

      [17:31:32,325][ERROR][sys-#89%jdbc2.MineJdbcPreparedStatementSelfTest0%][GridMapQueryExecutor] Failed to send error message.
      class org.apache.ignite.IgniteCheckedException: Failed to send message (node may have left the grid or TCP connection cannot be established due to firewall issues) [node=TcpDiscoveryNode [id=7a2ff77c-652c-4be6-b855-d1fdd53698e3, addrs=[127.0.0.1], sockAddrs=[/127.0.0.1:0], discPort=0, order=4, intOrder=4, lastExchangeTime=1459953091890, loc=false, ver=1.6.0#19700101-sha1:00000000, isClient=true], topic=TOPIC_QUERY, msg=GridQueryFailResponse [qryReqId=1, errMsg=class org.apache.ignite.IgniteCheckedException:Failed to execute SQL query.], policy=2]
      	at org.apache.ignite.internal.managers.communication.GridIoManager.send(GridIoManager.java:1290)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.send(GridIoManager.java:1354)
      	at org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.sendError(GridMapQueryExecutor.java:527)
      	at org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onQueryRequest(GridMapQueryExecutor.java:501)
      	at org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onMessage(GridMapQueryExecutor.java:184)
      	at org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor$2.onMessage(GridMapQueryExecutor.java:159)
      	at org.apache.ignite.internal.managers.communication.GridIoManager$ArrayListener.onMessage(GridIoManager.java:2039)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1219)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:847)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.access$1700(GridIoManager.java:105)
      	at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:810)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      	Suppressed: class org.apache.ignite.IgniteCheckedException: Failed to execute SQL query.
      		at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:832)
      		at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:855)
      		at org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onQueryRequest(GridMapQueryExecutor.java:454)
      		... 10 more
      	Caused by: org.h2.jdbc.JdbcSQLException: Deserialization failed, cause: "class org.apache.ignite.binary.BinaryObjectException: Not enough data to read the value [position=1, requiredBytes=4, remainingBytes=0]"; SQL statement:
      SELECT
      ID __C0
      FROM "".ACTIVITY
      WHERE ID > 10 [90027-175]
      		at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
      		at org.h2.message.DbException.get(DbException.java:161)
      		at org.h2.util.Utils.deserialize(Utils.java:413)
      		at org.h2.value.ValueJavaObject$NotSerialized.getObject(ValueJavaObject.java:162)
      		at org.h2.value.ValueJavaObject$NotSerialized.compareSecure(ValueJavaObject.java:102)
      		at org.h2.value.Value.compareTo(Value.java:921)
      		at org.h2.engine.Database.compare(Database.java:320)
      		at org.h2.expression.Comparison.compareNotNull(Comparison.java:283)
      		at org.h2.expression.Comparison.getValue(Comparison.java:254)
      		at org.h2.expression.Expression.getBooleanValue(Expression.java:180)
      		at org.h2.command.dml.Select.queryFlat(Select.java:529)
      		at org.h2.command.dml.Select.queryWithoutCache(Select.java:632)
      		at org.h2.command.dml.Query.query(Query.java:297)
      		at org.h2.command.dml.Query.query(Query.java:284)
      		at org.h2.command.dml.Query.query(Query.java:36)
      		at org.h2.command.CommandContainer.query(CommandContainer.java:91)
      		at org.h2.command.Command.executeQuery(Command.java:196)
      		at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:106)
      		at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:829)
      		... 12 more
      	Caused by: class org.apache.ignite.binary.BinaryObjectException: Not enough data to read the value [position=1, requiredBytes=4, remainingBytes=0]
      		at org.apache.ignite.internal.binary.streams.BinaryAbstractInputStream.ensureEnoughData(BinaryAbstractInputStream.java:300)
      		at org.apache.ignite.internal.binary.streams.BinaryAbstractInputStream.readInt(BinaryAbstractInputStream.java:127)
      		at org.apache.ignite.internal.binary.BinaryUtils.doReadFloatArray(BinaryUtils.java:1117)
      		at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1541)
      		at org.apache.ignite.internal.binary.GridBinaryMarshaller.deserialize(GridBinaryMarshaller.java:295)
      		at org.apache.ignite.internal.binary.BinaryMarshaller.unmarshal(BinaryMarshaller.java:109)
      		at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$5.deserialize(IgniteH2Indexing.java:1524)
      		at org.h2.util.Utils.deserialize(Utils.java:392)
      		... 28 more
      Caused by: class org.apache.ignite.spi.IgniteSpiException: Destination node is not in topology: 7a2ff77c-652c-4be6-b855-d1fdd53698e3
      	at org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.reserveClient(TcpCommunicationSpi.java:2070)
      	at org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.sendMessage0(TcpCommunicationSpi.java:1958)
      	at org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.sendMessage(TcpCommunicationSpi.java:1924)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.send(GridIoManager.java:1285)
      	... 13 more
      

      Also, we cannot use primitives as fields it will cause the same issue (like int}, {{long...). As I understand h2 cannot work with java primitives and wrappers should be used.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ashutak Artem Shutak
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: