]
Steven Hawkins updated TEIID-5728:
----------------------------------
Component/s: Query Engine
JSON production functions JSONOBJECT and JSONARRAY_AGG producing
CLOBs
----------------------------------------------------------------------
Key: TEIID-5728
URL:
https://issues.jboss.org/browse/TEIID-5728
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Ramesh Reddy
Assignee: Steven Hawkins
Priority: Major
JSON production functions like JSONOBJECT and JSONARRAY_AGG seem to be still returning a
clob object rather than a 'json' object even though Teiid has the first class data
type for json now.
for ex:
{code}
CREATE VIRTUAL PROCEDURE CustomerJSON(IN p1 integer) RETURNS TABLE (json_out json)
OPTIONS (UPDATECOUNT 0, "REST:METHOD" 'GET', "REST:URI"
'CustomerJson/{p1}') AS
BEGIN
SELECT JSONOBJECT(JSONARRAY_AGG(JSONOBJECT(SSN, Name))) AS json_out FROM
accounts.customer;
END
{code}
would fail with
{code}
Caused by: org.teiid.deployers.VirtualDatabaseException: TEIID40095 TEIID31080
virt.CustomerJSON validation error: TEIID31121 The expected result set of the procedure
virt.CustomerJSON does not match the result set from returnable statement SELECT
JSONOBJECT(JSONARRAY_AGG(JSONOBJECT(SSN, Name))) AS json_out FROM accounts.customer; use
WITHOUT RETURN to indicate the statement should not be returned - The definition for
virt.CustomerJSON has the wrong type for column 1. Expected json, but was clob.
at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:845)
~[teiid-runtime-12.2.0-SNAPSHOT.jar:12.2.0-SNAPSHOT]
at org.teiid.spring.autoconfigure.TeiidServer.deployVDB(TeiidServer.java:315)
~[classes/:na]
... 17 common frames omitted
{code}