typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[BUG] prepared statement fails to add Long when entity is also in a graphDB #108

Closed barmpis closed 3 years ago

barmpis commented 3 years ago

Describe the bug

When using a prepared statement to insert into a relational database an entity containing a bigint value, whereby this entity is also referenced by a graph database, the insert fails as follows. NB: simple inserts work fine.

Query

{"query":"insert AC_GNL{AC_ID:??AC_ID}",
"parameterNames":["AC_ID"],
"parameterTypes":["bigint"],
"boundRows":[["7542938"]]
}

Model

entity AC_GNL {
    AC_ID: bigint

    HAS :-> Has."Has.account"[1]
}

entity OBLG_GNL {
    OBLG_ID: bigint

    HAS :-> Has."Has.customer"[1]
}

entity Has {
    customer -> OBLG_GNL[1]
    account -> AC_GNL[1] 
}

relationaldb DWH {
    tables {
        table { 
            Customers : OBLG_GNL
        }
        table {
            Accounts : AC_GNL
        }
    }
}

graphdb Marketing {
    edges {
        edge Has {
            from customer
            to account
        }
    }
}

Expected behavior

The prepared statement should succeed, inserting the entity.

REST API

typhonql-server_1 | java.lang.RuntimeException: Query executor does not know how to serialize object of type class java.lang.Long typhonql-server_1 | (internal error) typhonql-server_1 | at $typhonql$(|main://$typhonql$|) typhonql-server_1 | typhonql-server_1 | java.lang.RuntimeException: Query executor does not know how to serialize object of type class java.lang.Long typhonql-server_1 | at nl.cwi.swat.typhonql.backend.neo4j.Neo4JEngine.toNeo4JObject(Neo4JEngine.java:110) typhonql-server_1 | at nl.cwi.swat.typhonql.backend.neo4j.Neo4JEngine.lambda$3(Neo4JEngine.java:82)

barmpis commented 3 years ago

thanks, this issue has been resolved in the latest dev image.