这是indexloc提供的服务,不要输入任何密码
Skip to content

Support non-computed nested array globals. #8611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dnwpark
Copy link
Contributor

@dnwpark dnwpark commented Apr 16, 2025

related #4309

Allow globals such as:

global foo -> array<array<int64>>;

Which can then be set by:

set global foo := [[1, 2, 3], [4, 5, 6]];

@dnwpark dnwpark force-pushed the array-of-array-global branch 6 times, most recently from 2a9734b to 41ef8f0 Compare April 24, 2025 00:08
@dnwpark dnwpark force-pushed the array-of-array-global branch from 41ef8f0 to 32db320 Compare April 28, 2025 17:10
Comment on lines +181 to +212
(SELECT
"expr-5~2"."array_value~3" AS "array_value~4"
FROM
LATERAL
(SELECT
(SELECT
"0"
FROM
-- EXTRA unnest(array[])
unnest(ARRAY[
-- INDEX INDIRECTION
edgedb_v7_2f26206480._index(
"expr-3~2"."array_value~2",
($2)::int8,
'ERROR MESSAGE'
)
]) AS ("0" int8[])
) AS "array_value~3"
FROM
LATERAL
-- INITAL ARRAY [[1]]
(SELECT
ARRAY[ROW("expr-2~2"."array_value~1")]
AS "array_value~2"
FROM
LATERAL
(SELECT
ARRAY[($1)::int8]
AS "array_value~1"
) AS "expr-2~2"
) AS "expr-3~2"
) AS "expr-5~2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is from a previous PR, but trim the comment example code down. It includes some extra irrelevant stuff: an extra wrapper to produce serialized, the toplevel NULL filter, an inject LIMIT

@msullivan
Copy link
Member

I found one problem while poking around with testing:

_localdev:main> 
select schema::Array { name } filter .name = 'array<array<std|int64>>';
{}
_localdev:main> 
create global compositeAA -> array<array<int64>>;
OK: CREATE GLOBAL
_localdev:main> 
drop global compositeAA;
OK: DROP GLOBAL
_localdev:main> 
select schema::Array { name } filter .name = 'array<array<std|int64>>';
{Object {name: 'array<array<std|int64>>'}}

Not all of the types get cleaned up on delete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants