traces of lists
play

Traces of lists Jzsef Marton Budapest University of Technology and - PowerPoint PPT Presentation

Traces of lists Jzsef Marton Budapest University of Technology and Economics 2017-05-10, oCIM2@London Jzsef Marton - Traces of lists 1 CIR-2017-220 Specify order of list elements in list constructing functions collect( expr ) -


  1. Traces of lists József Marton Budapest University of Technology and Economics 2017-05-10, oCIM2@London József Marton - Traces of lists 1

  2. CIR-2017-220 Specify order of list elements in list constructing functions collect( expr ) - aggregates expr into a list ● order of elements not specified, input ordering?? (if any) #165 ● what if collecting more lists with different ordering? ● List comprehensions? #190, #202 – extend syntax – For the current syntax: ● UNWIND range(1, 10) as i // 1st query step RETURN collect(i ORDER BY i ASC) AS l // 2nd query step For CIP2017-04-13 syntax ● UNWIND range(1, 10) as i // 1st query step RETURN collect OF i ORDER BY i ASC AS l // 2nd query step 2017-05-10, oCIM2@London József Marton - Traces of lists 2

  3. CIR TODO Resultset ordering between query steps Does ordering matter in subsequent query steps? ● MATCH (n) WITH n O R D E R b y n . v a l u e OPTIONAL MATCH (n)-->(m) RETURN n, m Another example for collecting list in #165 ● If it matters, ● pros: intuitive, currently(*) this is the way to set order for collect – *: see CIR-2017-220 cons: poses difficulties(*) for parallel query evaluation – *: performance loss 2017-05-10, oCIM2@London József Marton - Traces of lists 3

  4. CIR-2017-234 OPTIONAL UNWIND Given four persons and the languages they command ● CREATE (:Demo {name: 'Alice', languages: ['en', 'de', 'gr'] }) , (:Demo {name: 'Bob', languages: ['en', 'de'] }) , (:Demo {name: 'Cecil', languages: [] }) , (:Demo {name: 'Dennis' }) MATCH (n:Demo) MATCH (n:Demo) UNWIND n.languages AS lang OPTIONAL UNWIND n.languages AS lang RETURN n.name, lang RETURN n.name, lang ╒════════╤══════╕ ╒════════╤══════╕ │"n.name"│"lang"│ │"n.name"│"lang"│ ╞════════╪══════╡ ╞════════╪══════╡ │"Alice" │"en" │ │"Alice" │"en" │ ├────────┼──────┤ ├────────┼──────┤ │"Alice" │"de" │ │"Alice" │"de" │ ├────────┼──────┤ ├────────┼──────┤ │"Alice" │"gr" │ │"Alice" │"gr" │ ├────────┼──────┤ ├────────┼──────┤ │"Bob" │"en" │ │"Bob" │"en" │ ├────────┼──────┤ ├────────┼──────┤ │"Bob" │"de" │ │"Bob" │"de" │ └────────┴──────┘ ├────────┼──────┤ │"Cecil" │NULL │ 2017-05-10, oCIM2@London József Marton - Traces of lists 4 ├────────┼──────┤ To be decided --> │"Dennis"│NULL │ └────────┴──────┘

  5. That‘s all 1. Specify order of list elements in list constructing functions 2. Resultset ordering between query steps 3. OPTIONAL UNWIND Content presented here are a collection of current Cypher Improvement Requests (CIR), problems and ideas. They might change if/when they are built in the openCypher language. 2017-05-10, oCIM2@London József Marton - Traces of lists 5

Recommend


More recommend