Skip to content
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

Matching no types to the right from isa throws an error #7011

Open
izmalk opened this issue Mar 20, 2024 · 1 comment
Open

Matching no types to the right from isa throws an error #7011

izmalk opened this issue Mar 20, 2024 · 1 comment

Comments

@izmalk
Copy link
Member

izmalk commented Mar 20, 2024

Description

When matching types, there can be a situation where no types are matched by the schema.
Using a concept variable that matches no types as a type in an isa produces an error.

Environment

  1. TypeDB distribution: Core
  2. TypeDB version: 2.26.6
  3. Environment: macOS
  4. Client and version: Studio 2.26.0
  5. Other details:

Reproducible Steps

  1. Set up

Any schema with no @key annotations.
The @key here is not of utmost importance, just a convenient way of matching no types.

  1. Execute
match
$f isa! $type;
$type owns $a @key;
get;
  1. Unexpected result
[QRY16] Invalid Query Pattern: Could not infer compatible types for the match pattern:
'{{ $type owns $a@@key; 
$f isa! $type; }}'.

Expected result

Empty collection (iterator/stream).

Additional information

Relevant logs from TypeDB or Driver:

14:32:11.725 [typedb-service::0] ERROR com.vaticle.typedb.core.server.TransactionService -- [QRY16] Invalid Query Pattern: Could not infer compatible types for the match pattern:
'{{ $type owns $a@@key;
$f isa! $type; }}'.

I'm not sure why @ is duplicated in the server logs.

@izmalk izmalk changed the title Matching no types in a cVar and using the cVar to the right from isa throws an error Matching no types to the right from isa throws an error Mar 20, 2024
@flyingsilverfin
Copy link
Member

Makes sense.
I've fixed the wrong toString for now!

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

No branches or pull requests

2 participants