alibaba / alibaba/GraphScope

[BUG] GIE ouputs unexpected physical plan on query bi12

Open
#2,757 0 comments 0 reactions 2 assignees Claimed by @BingqingLyu View on GitHub
Dominant language
C++
Stars
3.6k
Forks
468
Avg merge
29m
Merged PRs (30d)
1

Description

bi12 query (Cypher)
```
MATCH
(person:PERSON)<-[:HASCREATOR]-(msg)-[:REPLYOF*0..7]->(reply:POST)
WHERE
msg.length < 80 and msg.creationDate > 20120626000000000
and (reply.language = 'es' or reply.language = 'ta' or reply.language = 'pt')
RETURN person.id
```

Current physical plan:
```
PhysicalOpr {
opr: Some(
Operator {
op_kind: Some(
Scan(
Scan {
scan_opt: Vertex,
alias: Some(
2,
),
params: Some(
QueryParams {
...
predicate: Some(
Expression {
operators: [
ExprOpr {
node_type: Some(
IrDataType {
r#type: Some(
DataType(
Int64,
),
),
},
),
item: Some(
Var(
Variable {
tag: None,
property: Some(
Property {
item: Some(
Key(
NameOrId {
item: Some(
Name(
"language",
),
),
},
),
),
},
),
node_type: Some(
IrDataType {
r#type: Some(
DataType(
Int64,
),
),
},
),
},
),
),
},
...
PhysicalOpr {
opr: Some(
Operator {
op_kind: Some(
Path(
PathExpand {
base: Some(
ExpandBase {
edge_expand: Some(
EdgeExpand {
...
}
),
get_v: Some(
GetV {
tag: None,
opt: Itself,
params: Some(
QueryParams {
tables: [
NameOrId {
item: Some(
Id(
3,
),
),
},
],
columns: [],
is_all_columns: false,
limit: None,
predicate: None,
sample_ratio: 1.0,
extra: {},
},
),
alias: Some(
2,
),
},
),
},
),
...
```

Expected physical plan:
```
PhysicalOpr {
opr: Some(
Operator {
op_kind: Some(
Scan(
Scan {
scan_opt: Vertex,
alias: Some(
2,
),
params: Some(
QueryParams {
...
predicate: Some(
Expression {
operators: [
ExprOpr {
node_type: Some(
IrDataType {
r#type: Some(
DataType(
String,
),
),
},
),
item: Some(
Var(
Variable {
tag: None,
property: Some(
Property {
item: Some(
Key(
NameOrId {
item: Some(
Name(
"language",
),
),
},
),
),
},
),
node_type: Some(
IrDataType {
r#type: Some(
DataType(
String,
),
),
},
),
},
),
),
},
...
PhysicalOpr {
opr: Some(
Operator {
op_kind: Some(
Path(
PathExpand {
base: Some(
ExpandBase {
edge_expand: Some(
EdgeExpand {
...
}
),
get_v: Some(
GetV {
tag: None,
opt: Itself,
params: Some(
QueryParams {
tables: [],
columns: [],
is_all_columns: false,
limit: None,
predicate: None,
sample_ratio: 1.0,
extra: {},
},
),
alias: None,
},
),
},
),
...
```

Problems:
1. Incorrect DataType in Scan Operator; Int64 -> String
2. Incorrect label filter in PathExpand-getv; [3(POST)] - > []
3. Incorrect alias in PathExpand-getv; Some(2) -> None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.