Skip to content

Commit 4f2d244

Browse files
committed
[prql] bump prqlc version and fix the annotator
1 parent 9d29bf2 commit 4f2d244

12 files changed

Lines changed: 76 additions & 32 deletions

src/internals/sql-ref.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5206,6 +5206,16 @@ stats.hist *col* *\[slice:'1h'\]* *\[top:10\]*
52065206
tslice v
52075207
2017-02⋯.000000 {"gw":3,"hw":1}
52085208

5209+
To chart the values of ex_procname for every second:
5210+
5211+
.. code-block:: custsqlite
5212+
5213+
;from lnav_example_log | stats.hist ex_procname slice:'1s'
5214+
tslice v
5215+
2017-02⋯.000000 {"gw":1,"hw":1}
5216+
2017-02⋯.000000 {"gw":1}
5217+
2017-02⋯.000000 {"gw":1}
5218+
52095219
**See Also**
52105220
:ref:`prql_aggregate`, :ref:`prql_append`, :ref:`prql_derive`, :ref:`prql_filter`, :ref:`prql_from`, :ref:`prql_group`, :ref:`prql_join`, :ref:`prql_select`, :ref:`prql_sort`, :ref:`prql_take`, :ref:`stats_average_of`, :ref:`stats_by`, :ref:`stats_count_by`, :ref:`stats_sum_of`, :ref:`utils_distinct`
52115221

src/sql_commands.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,11 @@ static readline_context::command_t sql_commands[] = {
961961
"To chart the values of ex_procname over time",
962962
"from lnav_example_log | stats.hist ex_procname",
963963
help_example::language::prql,
964+
})
965+
.with_example({
966+
"To chart the values of ex_procname for every second",
967+
"from lnav_example_log | stats.hist ex_procname slice:'1s'",
968+
help_example::language::prql,
964969
}),
965970
nullptr,
966971
"prql-source",

src/sql_util.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,11 @@ annotate_prql_statement(attr_line_t& al)
21372137
saw_id_dot = true;
21382138
} else {
21392139
fqids.emplace_back(id_start.value());
2140-
id_start = std::nullopt;
2140+
if (attr.sa_type == &PRQL_IDENTIFIER_ATTR) {
2141+
id_start = attr.sa_range;
2142+
} else {
2143+
id_start = std::nullopt;
2144+
}
21412145
saw_id_dot = false;
21422146
}
21432147
} else {

src/third-party/lnav-rs-ext/Cargo.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/third-party/lnav-rs-ext/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ doc = false
2323
# Build latest:
2424
# prqlc = { git = "https://github.com/PRQL/prql.git" }
2525
# Build deterministic:
26-
prqlc = "0.13.6"
26+
prqlc = "0.13.10"
2727
cxx = "1.0"
2828
log = "0.4"
2929
miette = "7.6.0"

test/expected/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ dist_noinst_DATA = \
506506
test_logfile.sh_341e491abcf8772422bafb8b0eaea6492da230f6.out \
507507
test_logfile.sh_3fc6bfd8a6160817211f3e14fde957af75b9dbe7.err \
508508
test_logfile.sh_3fc6bfd8a6160817211f3e14fde957af75b9dbe7.out \
509+
test_logfile.sh_438ab9544c6e77fdab0726762ae5eabe93b47e3b.err \
510+
test_logfile.sh_438ab9544c6e77fdab0726762ae5eabe93b47e3b.out \
509511
test_logfile.sh_4a2a907fcb069b8d6e65961a7b2e796d6c3a87b1.err \
510512
test_logfile.sh_4a2a907fcb069b8d6e65961a7b2e796d6c3a87b1.out \
511513
test_logfile.sh_4c4c80c159b6cd067a83eaefd07ba737e65af3e8.err \
@@ -816,6 +818,8 @@ dist_noinst_DATA = \
816818
test_sql_anno.sh_1b29488b949c294479aa6054f80a35bc106b454b.out \
817819
test_sql_anno.sh_207c588824271813ea54748da84ee385159d385e.err \
818820
test_sql_anno.sh_207c588824271813ea54748da84ee385159d385e.out \
821+
test_sql_anno.sh_20e47873b0d64f8a15eec3c3cc3411c37b39dcfc.err \
822+
test_sql_anno.sh_20e47873b0d64f8a15eec3c3cc3411c37b39dcfc.out \
819823
test_sql_anno.sh_2484b6f741d7e3638e64582cbafbcbf7e970ddd8.err \
820824
test_sql_anno.sh_2484b6f741d7e3638e64582cbafbcbf7e970ddd8.out \
821825
test_sql_anno.sh_331a152080d2e278b7cc0a37728eca1ded36ed72.err \

test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ current and previous stages of the pipeline.
599599
Using the top ten URLs query from earlier as an example, the PRQL
600600
version would be as follows:
601601

602-
▌;from access_log | stats.count_by cs_uri_stem | take 10 
602+
▌;from access_log | stats.count_by cs_uri_stem | take 10 
603603

604604
The first stage selects the data source, the web  access_log  table in
605605
this case. The  stats.count_by  transform is a convenience provided
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2019-11-19 21:55:41.251929 controller → host HCI_EVT 14 Rcvd Sniff Subrating
2-
2019-11-19 21:56:08.685812 controller → host HCI_EVT 9 Rcvd Mode Change
3-
2019-11-19 21:56:08.768083 controller → host HCI_EVT 9 Rcvd Mode Change
4-
2019-11-19 21:56:09.376379 controller → host HCI_EVT 14 Rcvd Sniff Subrating
5-
2019-11-19 22:07:30.886955 controller → host HCI_EVT 6 Rcvd Encryption Key Refresh Complete
1+
2019-11-19 21:55:41.251929 controller → host HCI_EVT 14 Rcvd Sniff Subrating
2+
2019-11-19 21:56:08.685812 controller → host HCI_EVT 9 Rcvd Mode Change
3+
2019-11-19 21:56:08.768083 controller → host HCI_EVT 9 Rcvd Mode Change
4+
2019-11-19 21:56:09.376379 controller → host HCI_EVT 14 Rcvd Sniff Subrating
5+
2019-11-19 22:07:30.886955 controller → host HCI_EVT 6 Rcvd Encryption Key Refresh Complete

test/expected/test_sql_anno.sh_20e47873b0d64f8a15eec3c3cc3411c37b39dcfc.err

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from access_log | stats.count_by `foo/bar` | take 10
2+
prql_stage ----------------
3+
prql_transform ----
4+
prql_fqid ----------
5+
prql_stage ---------------------------
6+
prql_pipe -
7+
prql_fqid --------------
8+
prql_fqid ---------
9+
prql_stage ---------
10+
prql_pipe -
11+
prql_transform ----
12+
prql_number --
13+
Formatted:
14+
from access_log
15+
stats.count_by `foo/bar`
16+
take 10
17+
18+
Cursor offset: 49

0 commit comments

Comments
 (0)