Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.

Handle expression aliases for RETURN and WITH clauses #16

Closed
4 tasks done
jmarton opened this issue Sep 18, 2016 · 5 comments
Closed
4 tasks done

Handle expression aliases for RETURN and WITH clauses #16

jmarton opened this issue Sep 18, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@jmarton
Copy link
Contributor

jmarton commented Sep 18, 2016

  • update EMF model to accomodate expression aliases
  • WONTFIX: in EMF model, change expression aliases from String to Variable. INSTEAD that, ExpressionVariable was introdiced to the relalg EMF model to accommodate maned expressions.
  • handle name collision between model variables and alias variables (see explanation below in 2nd comment)
  • handle in union (see Handle Union in opencypher2relalg compilation #9) either in cypher2relalg or at a later stage
  • handle WITH clause
  • handle WITH ... WHERE subclause (moved to Handle WITH...WHERE subclause #124)
  • implement variable chaining
@jmarton jmarton changed the title Handle variable aliases for return clauses Handle variable aliases for RETURN and WITH clauses Sep 24, 2016
@jmarton jmarton changed the title Handle variable aliases for RETURN and WITH clauses Handle expression aliases for RETURN and WITH clauses Dec 8, 2016
@szarnyasg
Copy link
Member

szarnyasg commented Dec 16, 2016

My thoughts:

@jmarton
Copy link
Contributor Author

jmarton commented Dec 16, 2016

@szarnyasg, it seems OK to make aliases variables.

However, for the compilation implementation, the following corner case also need to be handled correctly, i.e. return/with expression aliases hide variables with same name after all the return expressions are processed:

create (x0:AA {val: 0}), (x1:AA {val: 1}), (x2:BB {val: 2}), (x3:BB {val: 3});
match (n1:AA), (n2:BB)
return n1 as n2, n2 as n1
order by n1.val DESC, n2.val ASC;

This should result in:

       n2      |        n1
---------------+---------------
(:AA {val: 0}) | (:BB {val: 3})
(:AA {val: 1}) | (:BB {val: 3})
(:AA {val: 0}) | (:BB {val: 2})
(:AA {val: 1}) | (:BB {val: 2})

@jmarton jmarton self-assigned this Dec 16, 2016
@jmarton
Copy link
Contributor Author

jmarton commented Jan 30, 2017

Variable chaining is halfway with 1a425f1

@szarnyasg szarnyasg added this to the ADBIS milestone Mar 2, 2017
jmarton added a commit that referenced this issue Mar 28, 2017
This includes a weakly typed change to the relalg model that
allows ExpressionVariable to be referenced from an AttributeVariable.
@jmarton
Copy link
Contributor Author

jmarton commented Mar 30, 2017

WITH ... WHERE seems challenging because in this WHERE clause, one need to take into account variables created in the WITH clause, but this does not apply for expressions present in a MATCH ... WHERE clause.

@jmarton
Copy link
Contributor Author

jmarton commented Apr 2, 2017

WITH ... WHERE will be implemened in #124. Other than that, this is resolved, so closing it now.

@jmarton jmarton closed this as completed Apr 2, 2017
jmarton added a commit that referenced this issue Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants