Skip to content

SQL: map with count values after group by #1040

Description

@gramian

ArcadeDB Version: v23.3.1 (build da609e4/1680693032550/main)

JDK Version: Running on Mac OS X 12.6.4 - OpenJDK 64-Bit Server VM Homebrew

Applying the map function to a projected and a computed field (obtained by a grouping) fails with an internal error,
even though pairwise data is provided.

Expected behavior

{ "a": 2, "b": 2, "c:": 1 }

Actual behavior

Error on command execution
Error on command execution (PostCommandHandler)
java.lang.NullPointerException
	at com.arcadedb.serializer.JsonSerializer.serializeResult(JsonSerializer.java:154)
	at com.arcadedb.server.http.handler.AbstractQueryHandler.serializeResultSet(AbstractQueryHandler.java:102)
	at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:95)
	at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:92)
	at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:127)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
	at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
	at java.base/java.lang.Thread.run(Thread.java:829)

Steps to reproduce

Setup:

CREATE DOCUMENT TYPE doc;
INSERT INTO doc (chr) VALUES ('a'),('a'),('b'),('c'),('b');

Test:

SELECT map(chr, COUNT(*)) FROM doc GROUP BY chr;

compare w/o map:

SELECT chr, COUNT(*) FROM doc GROUP BY chr;

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions