Skip to content

class java.util.ArrayList cannot be cast to class java.util.Map #1193

@Ukuser36

Description

@Ukuser36

ArcadeDB Version:

23.6.1

Expected behavior

Providing data for a (?,?,?) parameters based insert query shouldn't need names on the fields (it didn't in Orient) and an ability to supply a JSON object for an EMBEDDED data type. Furthermore data appears to be inserted but isn't visible in the Web interface.

Actual behavior

  1. When inserting using INSERT and passing a 'params' attribute, if you omit the key for an insert field or (2) try to insert an array into an EMBEDDED field type, you get the error class java.util.ArrayList cannot be cast to class java.util.Map

  2. Furthermore running the following query produces an entry in the Companies table but no visible data.

Steps to reproduce

Create an INSERT statement with parameters and pass in an array of elements without field names. Furthermore, try to supply a JSON object as one of the values for an EMBEDDED field type.

  1. {"language":"sql","command":"INSERT INTO Companies (CompanyID,CompanyName,CountryID) VALUES (?,?,?)","params":[123,"Test company",826]}

  2. {"command":"UPDATE Companies SET SocialAccounts = ? WHERE @Rid = 'GIVEN_ID'","language":"sql","params":[{"SocialAccounts":[{"Url":"https://www.facebook.com/","Type":"fb"},{"Url":"https://www.linkedin.com/","Type":"li"}]}]}

  3. {"language":"sql","command":"INSERT INTO Companies (CompanyID,CompanyName,CountryID) VALUES (?,?,?)","params":{"CompanyID":123,"CompanyName":"Test company","CountryID":826}}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions