Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11350)

Issue 295920043: Implemented syntax-enhancements for SELECT FIRST and let(). (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years ago by the80srobot
Modified:
7 years, 11 months ago
CC:
rekall-dev_googlegroups.com
Base URL:
git@github.com:google/dotty.git@master
Visibility:
Public.

Description

Implemented syntax-enhancements for SELECT FIRST and let(). AST changes: - Added ast.Let, which is like ast.Map, but for a single value. stdlib changes: - Added a 'first' function which returns the first value from an IRepeated. Syntax changes: - let keyword in DottySQL: let(x = 10, y = 20) x + y # -> 30 - FIRST keyword in DottySQL: SELECT FIRST FROM ... WHERE ... maps to first(SELECT * FROM ... WHERE ...). BUG= R=bgalehouse@google.com Committed: f18cb1b63f1bcba166c23214c8cbaec9469bc93e

Patch Set 1 #

Patch Set 2 : Merged upstream changes. #

Patch Set 3 : Merge versioning scheme from upstream. #

Total comments: 2

Patch Set 4 : Got rid of FIRST. #

Patch Set 5 : Subselects tested and behave well by default. #

Total comments: 2

Patch Set 6 : Merged with upstream. #

Total comments: 2

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+502 lines, -66 lines) Patch
M efilter/ast.py View 1 1 chunk +4 lines, -0 lines 0 comments Download
M efilter/parsers/common/token_stream.py View 1 chunk +10 lines, -1 line 0 comments Download
M efilter/parsers/dottysql/grammar.py View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M efilter/parsers/dottysql/parser.py View 1 2 3 4 5 6 5 chunks +41 lines, -0 lines 0 comments Download
M efilter/protocols/associative.py View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
M efilter/protocols/repeated.py View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M efilter/scope.py View 1 chunk +1 line, -1 line 0 comments Download
M efilter/stdlib/core.py View 1 5 chunks +23 lines, -4 lines 0 comments Download
M efilter/transforms/asdottysql.py View 1 1 chunk +14 lines, -0 lines 0 comments Download
M efilter/transforms/solve.py View 1 2 3 4 23 chunks +197 lines, -52 lines 0 comments Download
M efilter_tests/testlib.py View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M efilter_tests/unit/api.py View 1 2 3 2 chunks +10 lines, -1 line 0 comments Download
M efilter_tests/unit/ext/lazy_repetition.py View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
M efilter_tests/unit/parsers/dottysql/parser.py View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
M efilter_tests/unit/protocols/repeated.py View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
M efilter_tests/unit/stdlib/core.py View 1 1 chunk +17 lines, -0 lines 0 comments Download
M efilter_tests/unit/transforms/asdottysql.py View 1 1 chunk +5 lines, -0 lines 0 comments Download
M efilter_tests/unit/transforms/solve.py View 1 2 3 4 5 6 2 chunks +92 lines, -0 lines 0 comments Download

Messages

Total messages: 11
the80srobot
8 years ago (2016-04-18 12:02:09 UTC) #1
the80srobot
8 years ago (2016-04-18 12:02:22 UTC) #2
scudette
How would one use a let in an sql statement? https://codereview.appspot.com/295920043/diff/40001/efilter_tests/unit/parsers/dottysql/parser.py File efilter_tests/unit/parsers/dottysql/parser.py (right): https://codereview.appspot.com/295920043/diff/40001/efilter_tests/unit/parsers/dottysql/parser.py#newcode104 ...
7 years, 12 months ago (2016-04-24 19:19:41 UTC) #3
the80srobot
I will submit a patchset today adding more docs and maybe making the syntax slightly ...
7 years, 11 months ago (2016-04-28 09:23:51 UTC) #4
the80srobot
So I actually decided to get rid of SELECT FIRST because it's a crutch and ...
7 years, 11 months ago (2016-04-29 09:56:14 UTC) #5
Joachim Metz
7 years, 11 months ago (2016-04-29 11:24:10 UTC) #6
the80srobot
The latest patchset enforces the expectation as to whether a value is repeated or not ...
7 years, 11 months ago (2016-04-29 13:40:24 UTC) #7
the80srobot
Looks like the performance cost is down to needing to materialize lazy results early if ...
7 years, 11 months ago (2016-04-29 13:45:13 UTC) #8
bgalehouse
LGTM https://codereview.appspot.com/295920043/diff/80001/efilter/scope.py File efilter/scope.py (right): https://codereview.appspot.com/295920043/diff/80001/efilter/scope.py#newcode67 efilter/scope.py:67: "IStructured; got %r." % (scope,)) ? (Leftover from ...
7 years, 11 months ago (2016-04-29 21:26:36 UTC) #9
the80srobot
Committed patchset #7 (id:120001) manually as f18cb1b63f1bcba166c23214c8cbaec9469bc93e (presubmit successful).
7 years, 11 months ago (2016-05-02 07:43:10 UTC) #10
the80srobot
7 years, 11 months ago (2016-05-02 07:43:17 UTC) #11
Message was sent while issue was closed.
https://codereview.appspot.com/295920043/diff/80001/efilter/scope.py
File efilter/scope.py (right):

https://codereview.appspot.com/295920043/diff/80001/efilter/scope.py#newcode67
efilter/scope.py:67: "IStructured; got %r." % (scope,))
On 2016/04/29 21:26:36, bgalehouse wrote:
> ? (Leftover from an edit?)

One of the wonders of Python: if the type of 'scope' ever is a tuple then this
would blow up, because the % operator then expects one % per member of the
tuple. Always giving it a tuple makes sure the TypeError is formatted correctly.

https://codereview.appspot.com/295920043/diff/100001/efilter_tests/unit/trans...
File efilter_tests/unit/transforms/solve.py (right):

https://codereview.appspot.com/295920043/diff/100001/efilter_tests/unit/trans...
efilter_tests/unit/transforms/solve.py:91: # Returning multiple resutls from
SELECT should work with set
On 2016/04/29 21:26:36, bgalehouse wrote:
> typo

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b