Repository navigation
Description
A scalar written to a declared LIST property is stored as a one-element list: INSERT INTO T SET anything = 5 stores [5]. For a LIST OF LONG or LIST OF DOUBLE, a list is converted element by element (longs = [5] is stored as [Long 5], doubles = [5] as [Double 5.0]), but a scalar is wrapped without being converted, and the wrapped element then fails the element check: longs = 5 and doubles = 5 are refused with "has been declared as LIST of 'LONG' but a value of type 'INTEGER' is used. Value: [5]". doubles = 5.0 is accepted because the literal is already a Double. openCypher goes both ways, because CREATE and SET type the literal 5 differently: CREATE (:V {ints: 5}) stores [5] in a LIST OF INTEGER and MATCH ... SET n.ints = 5 is refused ("a value of type 'LONG' is used"), while CREATE (:V {longs: 5}) is refused for a LIST OF LONG ("a value of type 'INTEGER' is used") and SET n.longs = 5 stores [5].
The element conversion for a scalar ofType runs only when the value is already a collection (Type.java#L474-L484); a scalar falls through to the LIST branch, which wraps it as it is (#L754-L767).
Related: #5261 (fixed) was nested LONG types lost on a remote save of MAP and LIST properties; #7777 (fixed) made the wrapped list mutable; #9002 (open) is a JSON array parameter wrapped into a nested list over HTTP. None covers a scalar on a typed list.
Repro
# lib/ holds the engine jar built at the commit under test and its dependencies
javac -cp "lib/*" ScalarIntoListOf.java
java -XX:+UseCompactObjectHeaders --add-modules=jdk.incubator.vector --enable-native-access=ALL-UNNAMED -cp "lib/*:." ScalarIntoListOf ./dbimport com.arcadedb.database.*;
import java.util.*;
public class ScalarIntoListOf {
public static void main(String[] args) {
System.out.println("ArcadeDB " + com.arcadedb.Constants.getRawVersion() + " (" + com.arcadedb.Constants.getBuildNumber() + "), Java "
+ System.getProperty("java.version"));
try (Database db = new DatabaseFactory(args[0]).create()) {
db.command("sql", "CREATE DOCUMENT TYPE T");
db.command("sql", "CREATE PROPERTY T.anything LIST");
db.command("sql", "CREATE PROPERTY T.longs LIST OF LONG");
db.command("sql", "CREATE PROPERTY T.doubles LIST OF DOUBLE");
for (String sql : new String[] { "INSERT INTO T SET anything = 5", "INSERT INTO T SET longs = [5]", "INSERT INTO T SET longs = 5",
"INSERT INTO T SET doubles = [5]", "INSERT INTO T SET doubles = 5", "INSERT INTO T SET doubles = 5.0" }) {
final String prop = sql.substring(sql.indexOf("SET ") + 4, sql.indexOf(" =", sql.indexOf("SET ")));
try {
final Object[] v = new Object[1];
db.transaction(() -> v[0] = db.command("sql", sql).next().getElement().get().get(prop));
final StringBuilder sb = new StringBuilder("[");
for (Object e : (List<?>) v[0])
sb.append(e.getClass().getSimpleName()).append(' ').append(e);
System.out.println(sql + " -> stored " + sb.append("]"));
} catch (Exception e) {
System.out.println(sql + " -> refused: " + e.getMessage());
}
}
db.command("sql", "CREATE VERTEX TYPE V");
db.command("sql", "CREATE PROPERTY V.ints LIST OF INTEGER");
db.command("sql", "CREATE PROPERTY V.longs LIST OF LONG");
db.transaction(() -> db.command("opencypher", "CREATE (:V {id: 0})").close());
for (String cy : new String[] { "CREATE (:V {id: 1, ints: 5})", "MATCH (n:V {id: 0}) SET n.ints = 5", "CREATE (:V {id: 2, longs: 5})",
"MATCH (n:V {id: 0}) SET n.longs = 5" }) {
try {
db.transaction(() -> db.command("opencypher", cy).close());
System.out.println(cy + " -> accepted");
} catch (Exception e) {
Throwable r = e;
while (r.getCause() != null && r.getCause() != r)
r = r.getCause();
System.out.println(cy + " -> refused: " + r.getMessage());
}
}
db.query("sql", "SELECT id, ints, longs FROM V ORDER BY id").forEachRemaining(r -> {
final StringBuilder sb = new StringBuilder(" V id " + r.getProperty("id") + ":");
for (String p : new String[] { "ints", "longs" })
if (r.getProperty(p) instanceof List<?> l)
sb.append(' ').append(p).append(" = ").append(l).append(" (").append(l.get(0).getClass().getSimpleName()).append(')');
System.out.println(sb);
});
}
}
}Output on main cecb369df9 (the engine jar's build stamp is 04bb03ebec, the newest commit in it that is not a merge), Temurin 25.0.4 with -XX:+UseCompactObjectHeaders. Temurin 21.0.12 printed the same lines apart from the Java version on the first line.
ArcadeDB 26.10.1-SNAPSHOT (04bb03ebec07fce19101595d65ca1e3bdf516755), Java 25.0.4
INSERT INTO T SET anything = 5 -> stored [Integer 5]
INSERT INTO T SET longs = [5] -> stored [Long 5]
INSERT INTO T SET longs = 5 -> refused: The property 'T.longs' has been declared as LIST of 'LONG' but a value of type 'INTEGER' is used. Value: [5]
INSERT INTO T SET doubles = [5] -> stored [Double 5.0]
INSERT INTO T SET doubles = 5 -> refused: The property 'T.doubles' has been declared as LIST of 'DOUBLE' but a value of type 'INTEGER' is used. Value: [5]
INSERT INTO T SET doubles = 5.0 -> stored [Double 5.0]
CREATE (:V {id: 1, ints: 5}) -> accepted
MATCH (n:V {id: 0}) SET n.ints = 5 -> refused: The property 'V.ints' has been declared as LIST of 'INTEGER' but a value of type 'LONG' is used. Value: [5]
CREATE (:V {id: 2, longs: 5}) -> refused: The property 'V.longs' has been declared as LIST of 'LONG' but a value of type 'INTEGER' is used. Value: [5]
MATCH (n:V {id: 0}) SET n.longs = 5 -> accepted
V id 0: longs = [5] (Long)
V id 1: ints = [5] (Integer)
Versions affected: main cecb369df9 on Temurin 25 and 21 and main 417314c18 (2026-09-17) print the same lines. 26.9.1 prints the same lines except the doubles = 5.0 line, where the literal 5.0 was a FLOAT and is refused ("a value of type 'FLOAT' is used").
Expected: longs = 5 is stored as [5L], as longs = [5] is, or a scalar is refused for every element type alike; either way the answer does not depend on whether the integer arrived as an Integer or a Long, or through CREATE or SET.
Activity
fix: review round 1, pending vertices kept as RIDs, no double edge ch…
fix: review round 2, out-of-range scalar refused in a typed LIST inst…
fix: review round 3, non-DETACH DELETE is atomic without an outer tra…
test: review round 4, relationship ids over Bolt, RETURN then fail, F…
test: review round 5, bucket bits over Bolt, DELETE with RETURN over …
test: review round 6, Integer/Map range cases, sharper assertions, in…
lvca commentedon Oct 4, 2026
Fixed in #9155 (26.10.1). A single value written to a
LIST OF <type>property is now converted to the element type, solongs = 5stores[5]as a LONG from SQL and from Cypher CREATE/SET. A number outside the element range is now refused instead of being clamped.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
tae898 commentedon Oct 4, 2026
Verified on main at
1b1ae3e477, which contains the #9155 mergec7b93c8fab, with the reproduction from the issue, unchanged, against0bb737d458, main before that merge, on Temurin 25 with-XX:+UseCompactObjectHeadersand on Temurin 21. Each build printed the same lines on both JDKs:0bb737d458JDK 250bb737d458JDK 211b1ae3e477JDK 251b1ae3e477JDK 21INSERT INTO T SET anything = 5[Integer 5][Integer 5]INSERT INTO T SET longs = [5][Long 5][Long 5]INSERT INTO T SET longs = 5[Long 5]INSERT INTO T SET doubles = [5][Double 5.0][Double 5.0]INSERT INTO T SET doubles = 5[Double 5.0]INSERT INTO T SET doubles = 5.0[Double 5.0][Double 5.0]CREATE (:V {id: 1, ints: 5})[Integer 5][Integer 5]MATCH (n:V {id: 0}) SET n.ints = 5[Integer 5]CREATE (:V {id: 2, longs: 5})[Long 5]MATCH (n:V {id: 0}) SET n.longs = 5[Long 5][Long 5]I also checked the Java API with
MutableDocument.set. A scalar whose class is not the element type (a Long intoLIST OF INTEGER, an Integer intoLIST OF LONG, an Integer, Long, or Float intoLIST OF DOUBLE, and an Integer intoLIST OF STRING) is now stored as one element of the declared type, where each was refused before, and so are the primitive arraysint[]intoLIST OF LONG,float[]intoLIST OF DOUBLE,double[]intoLIST OF FLOAT, andlong[]intoLIST OF INTEGER, also refused before. An out-of-range number, 3000000000 intoLIST OF INTEGERor 40000 intoLIST OF SHORT, is refused on both builds, as a list element and as a scalar, through the API and through SQL: the list form was already refused for its range, the scalar form was refused for its class and is now refused for its range, and the message now names the property.Thanks for the quick fix!
fix: Bolt node ids match id(n), DELETE node and relationships check a…
fix: Bolt node ids match id(n), DELETE node and relationships check a…
fix: review round 1, pending vertices kept as RIDs, no double edge ch…
fix: review round 2, out-of-range scalar refused in a typed LIST inst…
fix: review round 3, non-DETACH DELETE is atomic without an outer tra…
test: review round 4, relationship ids over Bolt, RETURN then fail, F…
test: review round 5, bucket bits over Bolt, DELETE with RETURN over …
test: review round 6, Integer/Map range cases, sharper assertions, in…