Skip to content

Commit 40b934d

Browse files
committed
GRAPH_TABLE pretty print & lexer/parser updates for non-reserved keywords
1 parent 4b18f35 commit 40b934d

File tree

52 files changed

+949
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+949
-833
lines changed

extension/partiql-extension-visualize/src/ast_to_dot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ impl ToDot<ast::FromLet> for AstToDot {
508508
let lbl = match &ast.kind {
509509
ast::FromLetKind::Scan => "Scan",
510510
ast::FromLetKind::Unpivot => "Unpivot",
511+
ast::FromLetKind::GraphTable => "GRAPH_TABLE",
511512
};
512513
let id = out.node_auto_labelled(lbl).id();
513514

partiql-ast/src/ast.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ pub struct FromLet {
811811
pub enum FromLetKind {
812812
Scan,
813813
Unpivot,
814+
GraphTable,
814815
}
815816

816817
#[derive(Visit, Clone, Debug, PartialEq)]
@@ -860,7 +861,7 @@ pub struct GraphMatch {
860861
pub pattern: AstNode<GraphPattern>,
861862
// TODO remove
862863
#[visit(skip)]
863-
pub shape: Option<GraphTableShape>,
864+
pub shape: GraphTableShape,
864865
}
865866

866867
// TODO #[derive(Visit, Clone, Debug, PartialEq)]
@@ -882,21 +883,12 @@ pub enum GraphMatchMode {
882883
RepeatableElements,
883884
}
884885

885-
/// A graph match clause as defined in GPML
886-
/// See https://arxiv.org/abs/2112.06217
887-
#[derive(Visit, Clone, Debug, PartialEq)]
888-
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
889-
pub struct GraphMatchExpr {
890-
#[visit(skip)] // TODO
891-
pub patterns: Vec<AstNode<GraphPathPattern>>,
892-
}
893-
894886
#[derive(Clone, Debug, PartialEq)]
895887
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
896-
pub enum GraphTableShape {
897-
Rows(AstNode<GraphTableRows>),
898-
Columns(AstNode<GraphTableColumns>),
899-
Export(AstNode<GraphTableExport>),
888+
pub struct GraphTableShape {
889+
pub rows: Option<AstNode<GraphTableRows>>,
890+
pub cols: Option<AstNode<GraphTableColumns>>,
891+
pub export: Option<AstNode<GraphTableExport>>,
900892
}
901893

902894
#[derive(Clone, Default, Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)