|
|
@ -150,7 +150,7 @@ class Node:
|
|
|
|
elif isinstance(self, Binary) and self.name == DIVISION:
|
|
|
|
elif isinstance(self, Binary) and self.name == DIVISION:
|
|
|
|
return list(set(self.left.result_format(rels)) - set(self.right.result_format(rels)))
|
|
|
|
return list(set(self.left.result_format(rels)) - set(self.right.result_format(rels)))
|
|
|
|
elif self.name == PROJECTION:
|
|
|
|
elif self.name == PROJECTION:
|
|
|
|
return [i.strip() for i in self.prop.split(',')]
|
|
|
|
return self.get_projection_prop()
|
|
|
|
elif self.name == PRODUCT:
|
|
|
|
elif self.name == PRODUCT:
|
|
|
|
return self.left.result_format(rels) + self.right.result_format(rels)
|
|
|
|
return self.left.result_format(rels) + self.right.result_format(rels)
|
|
|
|
elif self.name == SELECTION:
|
|
|
|
elif self.name == SELECTION:
|
|
|
@ -270,8 +270,6 @@ class Unary(Node):
|
|
|
|
self.prop = ','.join(f'{k}{ARROW}{v}' for k, v in renames.items())
|
|
|
|
self.prop = ','.join(f'{k}{ARROW}{v}' for k, v in renames.items())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parse_tokens(expression: List[Union[list, str]]) -> Node:
|
|
|
|
def parse_tokens(expression: List[Union[list, str]]) -> Node:
|
|
|
|
'''Generates the tree from the tokenized expression
|
|
|
|
'''Generates the tree from the tokenized expression
|
|
|
|
If no expression is specified then it will create an empty node'''
|
|
|
|
If no expression is specified then it will create an empty node'''
|
|
|
|