alf 0.9.3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +255 -129
- data/Gemfile +31 -1
- data/Gemfile.lock +17 -20
- data/LICENCE.md +1 -1
- data/Manifest.txt +2 -0
- data/README.md +37 -43
- data/TODO.md +1 -1
- data/alf.gemspec +10 -7
- data/alf.noespec +24 -13
- data/bin/alf +2 -2
- data/doc/commands/exec.md +16 -0
- data/doc/commands/help.md +11 -0
- data/doc/commands/main.md +33 -0
- data/doc/commands/show.md +19 -0
- data/doc/operators/non_relational/autonum.md +23 -0
- data/doc/operators/non_relational/clip.md +31 -0
- data/doc/operators/non_relational/coerce.md +15 -0
- data/doc/operators/non_relational/compact.md +20 -0
- data/doc/operators/non_relational/defaults.md +32 -0
- data/doc/operators/non_relational/generator.md +20 -0
- data/doc/operators/non_relational/sort.md +24 -0
- data/doc/operators/relational/extend.md +18 -0
- data/doc/operators/relational/group.md +27 -0
- data/doc/operators/relational/intersect.md +13 -0
- data/doc/operators/relational/join.md +27 -0
- data/doc/operators/relational/matching.md +20 -0
- data/doc/operators/relational/minus.md +12 -0
- data/doc/operators/relational/not-matching.md +20 -0
- data/doc/operators/relational/project.md +28 -0
- data/doc/operators/relational/quota.md +21 -0
- data/doc/operators/relational/rank.md +27 -0
- data/doc/operators/relational/rename.md +17 -0
- data/doc/operators/relational/restrict.md +25 -0
- data/doc/operators/relational/summarize.md +25 -0
- data/doc/operators/relational/ungroup.md +20 -0
- data/doc/operators/relational/union.md +14 -0
- data/doc/operators/relational/unwrap.md +20 -0
- data/doc/operators/relational/wrap.md +24 -0
- data/examples/csv/suppliers.csv +6 -0
- data/examples/logs/access.log +1000 -0
- data/examples/logs/combined.alf +2 -0
- data/examples/logs/hits.alf +14 -0
- data/examples/logs/not_found.alf +7 -0
- data/examples/logs/robots-cheating.alf +11 -0
- data/examples/logs/robots.alf +8 -0
- data/examples/northwind/customers.csv +92 -0
- data/examples/northwind/northwind.db +0 -0
- data/examples/northwind/orders.csv +831 -0
- data/examples/operators/clip.alf +1 -1
- data/examples/operators/database.alf +5 -6
- data/examples/operators/defaults.alf +1 -1
- data/examples/operators/group.alf +1 -1
- data/examples/operators/project.alf +2 -1
- data/examples/operators/pseudo-with.alf +2 -2
- data/examples/operators/quota.alf +2 -2
- data/examples/operators/summarize.alf +2 -2
- data/lib/alf/aggregator/aggregators.rb +77 -0
- data/lib/alf/aggregator/base.rb +95 -0
- data/lib/alf/aggregator/class_methods.rb +57 -0
- data/lib/alf/buffer/sorted.rb +48 -0
- data/lib/alf/command/class_methods.rb +27 -0
- data/lib/alf/command/doc_manager.rb +72 -0
- data/lib/alf/command/exec.rb +12 -0
- data/lib/alf/command/help.rb +31 -0
- data/lib/alf/command/main.rb +146 -0
- data/lib/alf/command/show.rb +33 -0
- data/lib/alf/environment/base.rb +37 -0
- data/lib/alf/environment/class_methods.rb +93 -0
- data/lib/alf/environment/explicit.rb +38 -0
- data/lib/alf/environment/folder.rb +62 -0
- data/lib/alf/extra/csv.rb +104 -0
- data/lib/alf/extra/logs.rb +100 -0
- data/lib/alf/extra/sequel.rb +77 -0
- data/lib/alf/{yaml.rb → extra/yaml.rb} +0 -0
- data/lib/alf/extra.rb +5 -0
- data/lib/alf/iterator/base.rb +38 -0
- data/lib/alf/iterator/class_methods.rb +22 -0
- data/lib/alf/iterator/proxy.rb +33 -0
- data/lib/alf/lispy/instance_methods.rb +157 -0
- data/lib/alf/operator/base.rb +74 -0
- data/lib/alf/operator/binary.rb +32 -0
- data/lib/alf/operator/cesure.rb +45 -0
- data/lib/alf/operator/class_methods.rb +132 -0
- data/lib/alf/operator/experimental.rb +9 -0
- data/lib/alf/operator/non_relational/autonum.rb +24 -0
- data/lib/alf/operator/non_relational/clip.rb +20 -0
- data/lib/alf/operator/non_relational/coerce.rb +21 -0
- data/lib/alf/operator/non_relational/compact.rb +62 -0
- data/lib/alf/operator/non_relational/defaults.rb +25 -0
- data/lib/alf/operator/non_relational/generator.rb +38 -0
- data/lib/alf/operator/non_relational/sort.rb +23 -0
- data/lib/alf/operator/nullary.rb +20 -0
- data/lib/alf/operator/relational/extend.rb +24 -0
- data/lib/alf/operator/relational/group.rb +32 -0
- data/lib/alf/operator/relational/intersect.rb +37 -0
- data/lib/alf/operator/relational/join.rb +106 -0
- data/lib/alf/operator/relational/matching.rb +45 -0
- data/lib/alf/operator/relational/minus.rb +37 -0
- data/lib/alf/operator/relational/not_matching.rb +45 -0
- data/lib/alf/operator/relational/project.rb +22 -0
- data/lib/alf/operator/relational/quota.rb +51 -0
- data/lib/alf/operator/relational/rank.rb +55 -0
- data/lib/alf/operator/relational/rename.rb +19 -0
- data/lib/alf/operator/relational/restrict.rb +20 -0
- data/lib/alf/operator/relational/summarize.rb +83 -0
- data/lib/alf/operator/relational/ungroup.rb +25 -0
- data/lib/alf/operator/relational/union.rb +32 -0
- data/lib/alf/operator/relational/unwrap.rb +21 -0
- data/lib/alf/operator/relational/wrap.rb +22 -0
- data/lib/alf/operator/shortcut.rb +53 -0
- data/lib/alf/operator/signature.rb +262 -0
- data/lib/alf/operator/transform.rb +27 -0
- data/lib/alf/operator/unary.rb +38 -0
- data/lib/alf/reader/alf_file.rb +24 -0
- data/lib/alf/reader/base.rb +119 -0
- data/lib/alf/reader/class_methods.rb +82 -0
- data/lib/alf/reader/rash.rb +28 -0
- data/lib/alf/relation/class_methods.rb +37 -0
- data/lib/alf/relation/instance_methods.rb +127 -0
- data/lib/alf/renderer/base.rb +72 -0
- data/lib/alf/renderer/class_methods.rb +58 -0
- data/lib/alf/renderer/rash.rb +19 -0
- data/lib/alf/{text.rb → renderer/text.rb} +1 -1
- data/lib/alf/tools/coerce.rb +14 -0
- data/lib/alf/tools/miscellaneous.rb +77 -0
- data/lib/alf/tools/to_lispy.rb +99 -0
- data/lib/alf/tools/to_ruby_literal.rb +14 -0
- data/lib/alf/tools/tuple_handle.rb +50 -0
- data/lib/alf/types/attr_list.rb +56 -0
- data/lib/alf/types/attr_name.rb +28 -0
- data/lib/alf/types/boolean.rb +12 -0
- data/lib/alf/types/heading.rb +96 -0
- data/lib/alf/types/ordering.rb +93 -0
- data/lib/alf/types/renaming.rb +57 -0
- data/lib/alf/types/summarization.rb +76 -0
- data/lib/alf/types/tuple_computation.rb +61 -0
- data/lib/alf/types/tuple_expression.rb +61 -0
- data/lib/alf/types/tuple_predicate.rb +49 -0
- data/lib/alf/version.rb +2 -2
- data/lib/alf.rb +193 -3714
- data/spec/integration/__database__/group.alf +1 -1
- data/spec/integration/__database__/suppliers_csv.csv +6 -0
- data/spec/integration/command/alf/alf.db +0 -0
- data/spec/integration/command/alf/alf_env_sqlite.cmd +1 -0
- data/spec/integration/command/alf/alf_env_sqlite.stdout +9 -0
- data/spec/integration/command/alf/alf_help.cmd +1 -0
- data/spec/integration/command/alf/alf_help.stdout +67 -0
- data/spec/integration/command/autonum/autonum_0.cmd +1 -1
- data/spec/integration/command/coerce/coerce_1.cmd +1 -0
- data/spec/integration/command/coerce/coerce_1.stdout +5 -0
- data/spec/integration/command/defaults/defaults_0.cmd +1 -1
- data/spec/integration/command/defaults/defaults_0.stdout +9 -9
- data/spec/integration/command/defaults/defaults_2.cmd +1 -0
- data/spec/integration/command/defaults/defaults_2.stdout +9 -0
- data/spec/integration/command/generator/generator_1.cmd +1 -0
- data/spec/integration/command/generator/generator_1.stdout +10 -0
- data/spec/integration/command/generator/generator_2.cmd +1 -0
- data/spec/integration/command/generator/generator_2.stdout +5 -0
- data/spec/integration/command/generator/generator_3.cmd +1 -0
- data/spec/integration/command/generator/generator_3.stdout +5 -0
- data/spec/integration/command/group/group_0.cmd +1 -1
- data/spec/integration/command/group/group_1.cmd +1 -1
- data/spec/integration/command/help/help_1.cmd +1 -0
- data/spec/integration/command/help/help_1.stdout +22 -0
- data/spec/integration/command/quota/quota_0.cmd +1 -1
- data/spec/integration/command/rank/rank_1.cmd +1 -1
- data/spec/integration/command/rank/rank_1.stdout +10 -10
- data/spec/integration/command/rank/rank_2.cmd +1 -1
- data/spec/integration/command/rank/rank_2.stdout +10 -10
- data/spec/integration/command/rank/rank_3.cmd +1 -1
- data/spec/integration/command/rank/rank_3.stdout +10 -10
- data/spec/integration/command/rank/rank_4.cmd +1 -1
- data/spec/integration/command/rank/rank_5.cmd +1 -1
- data/spec/integration/command/show/show_csv.cmd +1 -0
- data/spec/integration/command/show/show_csv.stdout +6 -0
- data/spec/integration/command/show/show_rash_2.cmd +1 -1
- data/spec/integration/command/show/show_rash_2.stdout +5 -5
- data/spec/integration/command/sort/sort_0.cmd +1 -1
- data/spec/integration/command/sort/sort_1.cmd +1 -1
- data/spec/integration/command/sort/sort_1.stdout +2 -2
- data/spec/integration/command/sort/sort_2.cmd +1 -0
- data/spec/integration/command/sort/sort_2.stdout +9 -0
- data/spec/integration/command/sort/sort_3.cmd +1 -0
- data/spec/integration/command/sort/sort_3.stdout +9 -0
- data/spec/integration/command/summarize/summarize_0.cmd +1 -1
- data/spec/integration/command/ungroup/ungroup_0.cmd +1 -1
- data/spec/integration/command/wrap/wrap_0.cmd +1 -1
- data/spec/integration/semantics/test_project.alf +5 -6
- data/spec/integration/semantics/test_rank.alf +16 -16
- data/spec/integration/test_command.rb +17 -6
- data/spec/integration/test_examples.rb +1 -1
- data/spec/regression/logs/apache_combined.log +5 -0
- data/spec/regression/logs/test_path_attribute.rb +25 -0
- data/spec/regression/relation/test_relation_allbut_all.rb +14 -0
- data/spec/shared/an_operator_class.rb +10 -5
- data/spec/spec_helper.rb +1 -7
- data/spec/unit/assumptions/test_set.rb +64 -0
- data/spec/unit/command/doc_manager/dynamic.md +1 -0
- data/spec/unit/command/doc_manager/example.md +1 -0
- data/spec/unit/command/doc_manager/example_1.txt +11 -0
- data/spec/unit/command/doc_manager/static.md +1 -0
- data/spec/unit/command/doc_manager/test_call.rb +49 -0
- data/spec/unit/csv/input.csv +3 -0
- data/spec/unit/csv/test_reader.rb +66 -0
- data/spec/unit/csv/test_renderer.rb +73 -0
- data/spec/unit/lispy/test_relation.rb +37 -0
- data/spec/unit/lispy/test_run.rb +40 -0
- data/spec/unit/lispy/test_tuple.rb +36 -0
- data/spec/unit/logs/apache_combined.log +5 -0
- data/spec/unit/logs/postgresql.log +29 -0
- data/spec/unit/logs/test_reader.rb +56 -0
- data/spec/unit/operator/non_relational/compact/{buffer_based.rb → test_buffer_based.rb} +0 -0
- data/spec/unit/operator/non_relational/test_clip.rb +1 -1
- data/spec/unit/operator/non_relational/test_coerce.rb +35 -0
- data/spec/unit/operator/non_relational/test_defaults.rb +15 -2
- data/spec/unit/operator/non_relational/test_generator.rb +78 -0
- data/spec/unit/operator/relational/join/test_hash_based.rb +4 -4
- data/spec/unit/operator/relational/matching/test_hash_based.rb +6 -6
- data/spec/unit/operator/relational/not_matching/test_hash_based.rb +4 -4
- data/spec/unit/operator/relational/summarize/test_hash_based.rb +10 -6
- data/spec/unit/operator/relational/summarize/test_sort_based.rb +18 -7
- data/spec/unit/operator/relational/test_group.rb +8 -8
- data/spec/unit/operator/relational/test_intersect.rb +3 -3
- data/spec/unit/operator/relational/test_minus.rb +3 -3
- data/spec/unit/operator/relational/test_project.rb +12 -2
- data/spec/unit/operator/relational/test_quota.rb +5 -6
- data/spec/unit/operator/relational/test_summarize.rb +9 -11
- data/spec/unit/operator/relational/test_union.rb +1 -1
- data/spec/unit/operator/relational/test_wrap.rb +1 -1
- data/spec/unit/operator/signature/test_collect_on.rb +45 -0
- data/spec/unit/operator/signature/test_initialize.rb +17 -0
- data/spec/unit/operator/signature/test_install.rb +56 -0
- data/spec/unit/operator/signature/test_option_parser.rb +36 -0
- data/spec/unit/operator/signature/test_parse_args.rb +60 -0
- data/spec/unit/operator/signature/test_parse_argv.rb +87 -0
- data/spec/unit/operator/signature/test_to_lispy.rb +102 -0
- data/spec/unit/operator/signature/test_to_shell.rb +103 -0
- data/spec/unit/operator/test_non_relational.rb +3 -1
- data/spec/unit/relation/test_relops.rb +20 -15
- data/spec/unit/sequel/alf.db +0 -0
- data/spec/unit/sequel/test_environment.rb +54 -0
- data/spec/unit/test_aggregator.rb +32 -22
- data/spec/unit/test_environment.rb +5 -0
- data/spec/unit/test_lispy.rb +4 -0
- data/spec/unit/test_relation.rb +5 -0
- data/spec/unit/text/test_cell.rb +6 -6
- data/spec/unit/text/test_row.rb +3 -3
- data/spec/unit/text/test_table.rb +6 -6
- data/spec/unit/tools/test_coalesce.rb +15 -0
- data/spec/unit/tools/test_coerce.rb +10 -0
- data/spec/unit/tools/test_to_lispy.rb +138 -0
- data/spec/unit/tools/test_to_ruby_literal.rb +10 -0
- data/spec/unit/tools/test_tuple_handle.rb +1 -59
- data/spec/unit/types/test_attr_list.rb +106 -0
- data/spec/unit/types/test_attr_name.rb +52 -0
- data/spec/unit/{test_heading.rb → types/test_heading.rb} +10 -0
- data/spec/unit/types/test_ordering.rb +127 -0
- data/spec/unit/types/test_renaming.rb +55 -0
- data/spec/unit/types/test_summarization.rb +63 -0
- data/spec/unit/types/test_tuple_computation.rb +60 -0
- data/spec/unit/types/test_tuple_expression.rb +64 -0
- data/spec/unit/types/test_tuple_predicate.rb +79 -0
- data/tasks/debug_mail.rake +1 -1
- data/tasks/debug_mail.txt +5 -0
- data/tasks/gh-pages.rake +63 -0
- metadata +325 -52
- data/spec/unit/operator/test_command_methods.rb +0 -38
- data/spec/unit/tools/test_ordering_key.rb +0 -94
- data/spec/unit/tools/test_parse_commandline_args.rb +0 -47
- data/spec/unit/tools/test_projection_key.rb +0 -83
data/CHANGELOG.md
CHANGED
@@ -1,164 +1,290 @@
|
|
1
|
-
# 0.
|
1
|
+
# 0.10.0 / 2011-08-15
|
2
2
|
|
3
|
-
|
3
|
+
## New recognized data sources
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
* Alf now provides an Environment implementation on top of a SQL database.
|
6
|
+
This means that SQL tables can now be used as data-sources. This feature
|
7
|
+
relies on the sequel gem ('gem install sequel' is required), that drives
|
8
|
+
recognized SQL servers. Then (don't forget that ALF_OPTS also exists):
|
9
|
+
|
10
|
+
% alf --env=postgres://user:password@host/database show table
|
11
|
+
|
12
|
+
* Alf now recognizes and allows manipulating .csv files as first-class data
|
13
|
+
sources. CSV output is also supported of course. Under ruby <= 1.9, the
|
14
|
+
fastercsv gem is required ('gem install fastercsv' is required). Then:
|
15
|
+
|
16
|
+
% alf restrict suppliers.csv -- "city == 'Paris'" (input)
|
17
|
+
% alf show suppliers --csv (output)
|
18
|
+
|
19
|
+
* Alf now recognizes and allows manipulating .log files as first-class data
|
20
|
+
sources. This feature relies on request-log-analyzer gem that provides the
|
21
|
+
parsers that Alf uses, and the log formats it recognizes
|
22
|
+
('gem install request-log-analyzer' is required). See examples/logs.
|
23
|
+
|
24
|
+
## New operators and enhancements
|
25
|
+
|
26
|
+
* A GENERATOR operator is introduced. It allows generating a relation with one
|
27
|
+
auto-number attribute, up to a given size.
|
28
|
+
|
29
|
+
* A COERCE operator is introduced. It provides a quick way to obtain type-safe
|
30
|
+
relations from type-unsafe sources like .csv files. For example:
|
31
|
+
|
32
|
+
% alf coerce mydirtyfile.csv -- name String price Float at Time
|
10
33
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
34
|
+
The coerce operator is of course available in Ruby as well:
|
35
|
+
|
36
|
+
(coerce "mydirtyfile.csv", :name => String, :price => Float, :at => Time)
|
37
|
+
|
38
|
+
* The DEFAULTS (non-relational) operator now accepts default values as tuple
|
39
|
+
expressions. When used in shell, provided default values are now evaluated
|
40
|
+
that way. This allows specifying default values as being computed on the
|
41
|
+
current tuple.
|
15
42
|
|
16
|
-
|
17
|
-
(not_matching suppliers, supplies)
|
43
|
+
* Aggregations in the Lispy DSL must not be prefixed by Agg:: anymore.
|
18
44
|
|
19
|
-
|
20
|
-
queries, as shown below. See 'alf help rank' for details.
|
21
|
-
|
22
|
-
# Give the three heaviest parts
|
23
|
-
(allbut (restrict (rank :parts, [[:weight, :desc]], :pos), lambda{ pos < 3 }), [:pos])
|
45
|
+
## Miscellaneous enhancements
|
24
46
|
|
25
|
-
*
|
47
|
+
* Added 'alf --input-reader' to specify $stdin format (csv, rash, etc.)
|
48
|
+
* Added 'alf -Ipath' that mimics ruby's -I (add path to $LOAD_PATH before run)
|
49
|
+
* Lispy#run supports command arguments to be passed as a string
|
50
|
+
* Lispy#run supports piped commands, with '|' as in shell
|
26
51
|
|
27
|
-
|
52
|
+
## Hurting changes to Lispy DSL (and therefore to Relation)
|
28
53
|
|
29
|
-
|
30
|
-
|
31
|
-
inline:
|
32
|
-
|
33
|
-
% export ALF_OPTS="--env=. --yaml"
|
34
|
-
% alf show suppliers
|
35
|
-
|
36
|
-
is the same as
|
37
|
-
|
38
|
-
% alf --env=. --yaml show suppliers
|
39
|
-
|
40
|
-
* 'alf --help' now distinguish experimental operators from those coming from
|
41
|
-
the (much more stable) TUTORIAL D specification. The former should be used
|
42
|
-
with care as they specification may change at any time.
|
54
|
+
* The attribute-name syntax of aggregation operators has been removed. The Agg::
|
55
|
+
prefix must not be specified anymore.
|
43
56
|
|
44
|
-
|
57
|
+
Agg::sum(:qty) # !! error !!
|
58
|
+
Agg::sum{ qty } # !! error !!
|
59
|
+
sum{ qty } # simply, and only!
|
45
60
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
61
|
+
* The group aggregation operator has been removed. It will probably be replaced
|
62
|
+
in a future version. In the meantime, the GROUP relational operator allows
|
63
|
+
obtaining similar results.
|
64
|
+
|
65
|
+
* Lispy syntax of CLIP has changed (when used with --allbut option)
|
66
|
+
|
67
|
+
(clip :suppliers, [:name, :city], true) (before)
|
68
|
+
(clip :suppliers, [:name, :city], :allbut => true) (after)
|
69
|
+
|
70
|
+
* Lispy syntax of DEFAULTS has changed (when used with --strict option)
|
71
|
+
|
72
|
+
(defaults :suppliers, {:country => 'Belgium'}, true) (before)
|
73
|
+
(defaults :suppliers, {:country => 'Belgium'}, :strict => true) (after)
|
74
|
+
|
75
|
+
* Lispy syntax of GROUP has changed (when used with --allbut option)
|
76
|
+
|
77
|
+
(group :supplies, [:sid], :supplying, true) (before)
|
78
|
+
(group :supplies, [:sid], :supplying, :allbut => true) (after)
|
79
|
+
|
80
|
+
* Lispy syntax of PROJECT has changed (when used with --allbut option)
|
81
|
+
|
82
|
+
(project :suppliers, [:name, :city], true) (before)
|
83
|
+
(project :suppliers, [:name, :city], :allbut => true) (after)
|
84
|
+
|
85
|
+
* Lispy syntax of SUMMARIZE has changed (when used with --allbut option)
|
86
|
+
|
87
|
+
(summarize :supplies, [:qty, :pid], {...}, true) (before)
|
88
|
+
(summarize :supplies, [:qty, :pid], {...}, :allbut => true) (after)
|
89
|
+
|
90
|
+
## Hurting changes in shell
|
91
|
+
|
92
|
+
* The attribute-name syntax of aggregation operators has been removed
|
93
|
+
|
94
|
+
sum(:qty) # !! error !!
|
95
|
+
sum{ qty } # works
|
96
|
+
|
97
|
+
* Shell syntax of GROUP has changed (option separator before introduced name)
|
98
|
+
|
99
|
+
% alf --text group supplies -- pid qty supplying (before)
|
100
|
+
% alf --text group supplies -- pid qty -- supplying (after)
|
101
|
+
|
102
|
+
* Shell syntax of WRAP has changed (option separator before introduced name)
|
103
|
+
|
104
|
+
% alf --text wrap suppliers -- city status loc_and_status (before)
|
105
|
+
% alf --text wrap suppliers -- city status -- loc_and_status (after)
|
106
|
+
|
107
|
+
* Shell syntax of QUOTA has changed (--by and --order become pure arguments)
|
108
|
+
|
109
|
+
% alf quota supplies --by=sid --order=qty -- position count sum_qty "sum{ qty }" (before)
|
110
|
+
% alf quota supplies -- sid -- qty -- position count sum_qty "sum{ qty }" (after)
|
111
|
+
|
112
|
+
* Shell syntax of RANK has changed (--order becomes a pure argument)
|
113
|
+
|
114
|
+
% alf rank parts --order=weight,desc,pid,asc -- position (before)
|
115
|
+
% alf rank parts -- weight desc pid asc -- position (after)
|
116
|
+
|
117
|
+
* Shell syntax of SUMMARIZE has changed (--by becomes a pure argument)
|
118
|
+
|
119
|
+
% alf summarize supplies --by=sid -- total_qty "sum{ qty }" (before)
|
120
|
+
% alf summarize supplies -- sid -- total_qty "sum{ qty }" (after)
|
121
|
+
|
122
|
+
## Bug fixes
|
123
|
+
|
124
|
+
* [In shell] Options are now correctly parsed in presence of option separators.
|
125
|
+
That is, every argument after a '--' separator is considered a non-option
|
126
|
+
argument.
|
127
|
+
|
128
|
+
# 0.9.3 / 2011-07-23
|
129
|
+
|
130
|
+
## New operators (available both in shell and in Lispy DSL)
|
131
|
+
|
132
|
+
* Added MATCHING and NOT MATCHING operators. These operators are useful
|
133
|
+
shortcuts for the following expressions.
|
134
|
+
|
135
|
+
(matching l, r) := (project (join l, r), [l's attributes])
|
136
|
+
(not_matching l, r) := (minus l, (matching l, r))
|
52
137
|
|
53
|
-
|
138
|
+
For example:
|
139
|
+
|
140
|
+
# Give suppliers who supply at least one part
|
141
|
+
(matching suppliers, supplies)
|
54
142
|
|
55
|
-
|
56
|
-
|
57
|
-
|
143
|
+
# Give suppliers who don't supply any part
|
144
|
+
(not_matching suppliers, supplies)
|
145
|
+
|
146
|
+
* Added RANK operator, which is useful for for computing quota queries as
|
147
|
+
illustrated below. See 'alf help rank' for details.
|
58
148
|
|
59
|
-
|
149
|
+
# Give the three heaviest parts
|
150
|
+
(restrict (rank :parts, [[:weight, :desc]], :pos), lambda{ pos < 3 })
|
60
151
|
|
61
|
-
|
152
|
+
## Enhancements when using Alf in shell
|
62
153
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
154
|
+
* added 'alf -r', that mimics 'ruby -r' (require library before run)
|
155
|
+
|
156
|
+
* When alf is invoked in shell (and only in this case), ALF_OPTS is used as
|
157
|
+
global options to apply as if they were specified inline:
|
158
|
+
|
159
|
+
% export ALF_OPTS="--env=. --yaml"
|
160
|
+
% alf show suppliers
|
161
|
+
|
162
|
+
is the same as
|
163
|
+
|
164
|
+
% alf --env=. --yaml show suppliers
|
165
|
+
|
166
|
+
* 'alf --help' now distinguishes experimental operators (quota in particular)
|
167
|
+
from those coming from the (much more stable) **Tutorial D** specification. The
|
168
|
+
former should be used with care as their specification may change at any
|
169
|
+
time.
|
170
|
+
|
171
|
+
## Enhancements when using Alf in Ruby
|
172
|
+
|
173
|
+
* Alf.lispy now accepts any argument recognized by Environment.autodetect; it
|
174
|
+
obtains its working Environment that way. Among others:
|
175
|
+
|
176
|
+
Alf.lispy(Alf::Environment.folder("path/to/an/existing/folder"))
|
177
|
+
|
178
|
+
is the same as:
|
179
|
+
|
180
|
+
Alf.lispy("path/to/an/existing/folder")
|
181
|
+
|
182
|
+
* Added Relation::DUM and Relation::DEE constants (relations of empty heading
|
183
|
+
with no and one tuple, respectively). They are also available as DUM and DEE
|
184
|
+
in Lispy functional expressions.
|
185
|
+
|
186
|
+
* Added a Heading abstraction, as a set of attribute (name, type) pairs.
|
187
|
+
|
188
|
+
## Internal enhancements (extension points)
|
189
|
+
|
190
|
+
* The Reader and Renderer classes accept a Hash of options as third
|
191
|
+
constructor argument. These options can be used by extension points.
|
192
|
+
|
193
|
+
* The Environment class now provides a class-based registering mechanism 'ala'
|
194
|
+
Reader and Renderer. This allows auto-detecting the target environment when
|
195
|
+
--env=... is used in shell. See Environment.autodetect and
|
196
|
+
Environment#recognizes? for contributing to this extension point.
|
197
|
+
|
198
|
+
* Internals now rely on Myrrha for code generation. This means that all
|
199
|
+
datatypes can now be safely used in relations and dumped to .rash files in
|
200
|
+
particular.
|
201
|
+
|
202
|
+
## Bug fixes
|
203
|
+
|
204
|
+
* Added Relation#allbut, forgotten in two previous releases
|
205
|
+
* Fixed (join xxx, DEE) and (join xxx, DUM)
|
206
|
+
* Fixed scoping bug when using attributes named :path, :expr or :block in
|
207
|
+
Lispy compiled expressions (coming from .alf files)
|
208
|
+
* Fixed 'alf --yaml show suppliers' that renderer a --text table instead of
|
209
|
+
a yaml output
|
210
|
+
* Fixed bugs when using Date and Time attributes with .rash files
|
211
|
+
* Fixed bugs when using Date and Time attributes in restrict expressions
|
212
|
+
compiled from the commandline
|
213
|
+
* Fixed a few bugs when using attribute names that are ruby keywords
|
214
|
+
(restrict & extend)
|
89
215
|
|
90
216
|
# 0.9.2 / 2011.07.13
|
91
217
|
|
92
|
-
|
218
|
+
# Bug fixes
|
93
219
|
|
94
|
-
|
220
|
+
* Fixed the "alf show" command (undefined method `chain')
|
95
221
|
|
96
222
|
# 0.9.1 / 2011.07.13
|
97
223
|
|
98
|
-
|
224
|
+
## Enhancements (public APIs)
|
99
225
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
is equivalent to
|
109
|
-
|
110
|
-
suppliers, cities = [...], [...]
|
111
|
-
suppliers.restrict(lambda{ status > 10 }).join(cities)
|
112
|
-
|
113
|
-
see README about how to obtain suppliers and cities relations in the first
|
114
|
-
place.
|
226
|
+
* Added the in-memory Alf::Relation data structure and associated tooling.
|
227
|
+
This allows using Alf in a object-oriented usual way, in addition to the
|
228
|
+
functional DSL:
|
229
|
+
|
230
|
+
Alf.lispy.evaluate {
|
231
|
+
(join (restrict :suppliers, lambda{ status > 10 }), :cities)
|
232
|
+
}
|
115
233
|
|
116
|
-
|
117
|
-
|
234
|
+
is equivalent to
|
235
|
+
|
236
|
+
suppliers, cities = [...], [...]
|
237
|
+
suppliers.restrict(lambda{ status > 10 }).join(cities)
|
238
|
+
|
239
|
+
see README about how to obtain suppliers and cities relations in the first
|
240
|
+
place.
|
118
241
|
|
119
|
-
|
120
|
-
|
242
|
+
* Summarize now accepts a --allbut option, to specify 'by' attributes from an
|
243
|
+
exclusion perspective
|
121
244
|
|
122
|
-
*
|
245
|
+
* .alf files are now evaluated in such a way that backtraces are "traceability
|
246
|
+
friendly"
|
123
247
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
to better conform to TUTORIAL D's terminology.
|
141
|
-
|
142
|
-
* Lispy#chain was kept public in 0.9.0 by error and has been entirely removed
|
143
|
-
from the DSL.
|
248
|
+
## Non backward-compatible changes to public APIs
|
249
|
+
|
250
|
+
* Lispy#with has been removed because not being stable enough. The clean way
|
251
|
+
of reusing sub-queries is as follows (non purely functional, so far)
|
252
|
+
|
253
|
+
kept_suppliers = (restrict :suppliers, lambda{ status > 10 })
|
254
|
+
with_countries = (join kept_suppliers, :cities)
|
255
|
+
supplying = (join with_countries, :supplies)
|
256
|
+
(summarize supplying,
|
257
|
+
[:country],
|
258
|
+
:which => Agg::group(:pid),
|
259
|
+
:total => Agg::sum{ qty })
|
260
|
+
|
261
|
+
* As a consequence, named data sources (Symbols, like :suppliers above) are
|
262
|
+
now resolved at compile time, which is less powerful, yet much simpler and
|
263
|
+
sound.
|
144
264
|
|
145
|
-
*
|
265
|
+
* Nest and Unnest have been renamed to Wrap and Unwrap respectively. This is
|
266
|
+
to better conform to **Tutorial D**'s terminology.
|
267
|
+
|
268
|
+
* Lispy#chain was kept public in 0.9.0 by error and has been entirely removed
|
269
|
+
from the DSL.
|
146
270
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
271
|
+
## Enhancements (internals)
|
272
|
+
|
273
|
+
* Reader.reader delegates to Reader.coerce when its first argument is not
|
274
|
+
a String. This allows calling Reader.reader(args.first || $stdin) in quickl
|
275
|
+
commands for example.
|
276
|
+
|
277
|
+
* Operator, Operator::Relational and Operator::NonRelational have a .each
|
278
|
+
class method that yields operator classes
|
153
279
|
|
154
|
-
|
280
|
+
## Bug fixes
|
155
281
|
|
156
|
-
|
157
|
-
|
158
|
-
|
282
|
+
* Fixed a bug that led to an Nil error when using unary operators on $stdin
|
283
|
+
* Fixed a bug when summarizing or sorting on Symbol attributes with ruby 1.8
|
284
|
+
* Fixed numerous crashes under rubinius
|
159
285
|
|
160
286
|
# 0.9.0 / 2011.06.19
|
161
287
|
|
162
|
-
|
288
|
+
## Enhancements
|
163
289
|
|
164
|
-
|
290
|
+
* Birthday!
|
data/Gemfile
CHANGED
@@ -1,2 +1,32 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
|
-
|
2
|
+
|
3
|
+
group :runtime do
|
4
|
+
gem "quickl", "~> 0.4.0"
|
5
|
+
gem "myrrha", "~> 1.2.0"
|
6
|
+
end
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem "rake", "~> 0.9.2"
|
10
|
+
gem "rspec", "~> 2.6.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
group :release do
|
14
|
+
gem "rake", "~> 0.9.2"
|
15
|
+
gem "rspec", "~> 2.6.0"
|
16
|
+
gem "wlang", "~> 0.10.2"
|
17
|
+
end
|
18
|
+
|
19
|
+
group :doc do
|
20
|
+
gem "rcov", "~> 0.9.9"
|
21
|
+
gem "yard", "~> 0.7.2"
|
22
|
+
gem "bluecloth", "~> 2.1.0"
|
23
|
+
gem "redcarpet", "~> 1.17.2"
|
24
|
+
end
|
25
|
+
|
26
|
+
group :extra do
|
27
|
+
gem "fastercsv", "~> 1.5.4"
|
28
|
+
gem "request-log-analyzer", "~> 1.11.0"
|
29
|
+
gem "sequel", "~> 3.25.0"
|
30
|
+
gem "sqlite3", "~> 1.3.0"
|
31
|
+
end
|
32
|
+
|
data/Gemfile.lock
CHANGED
@@ -1,25 +1,16 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
alf (0.9.3)
|
5
|
-
myrrha (~> 1.0.0)
|
6
|
-
quickl (~> 0.2.2)
|
7
|
-
|
8
1
|
GEM
|
9
2
|
remote: http://rubygems.org/
|
10
3
|
specs:
|
11
|
-
bluecloth (2.0
|
4
|
+
bluecloth (2.1.0)
|
12
5
|
diff-lcs (1.1.2)
|
13
|
-
|
14
|
-
myrrha (1.
|
15
|
-
|
16
|
-
highline (~> 1.6.0)
|
17
|
-
quickl (~> 0.2.0)
|
18
|
-
wlang (~> 0.10.1)
|
19
|
-
quickl (0.2.2)
|
6
|
+
fastercsv (1.5.4)
|
7
|
+
myrrha (1.2.0)
|
8
|
+
quickl (0.4.0)
|
20
9
|
rake (0.9.2)
|
21
10
|
rcov (0.9.9)
|
22
11
|
rcov (0.9.9-java)
|
12
|
+
redcarpet (1.17.2)
|
13
|
+
request-log-analyzer (1.11.0)
|
23
14
|
rspec (2.6.0)
|
24
15
|
rspec-core (~> 2.6.0)
|
25
16
|
rspec-expectations (~> 2.6.0)
|
@@ -28,6 +19,8 @@ GEM
|
|
28
19
|
rspec-expectations (2.6.0)
|
29
20
|
diff-lcs (~> 1.1.2)
|
30
21
|
rspec-mocks (2.6.0)
|
22
|
+
sequel (3.25.0)
|
23
|
+
sqlite3 (1.3.3)
|
31
24
|
wlang (0.10.2)
|
32
25
|
yard (0.7.2)
|
33
26
|
|
@@ -36,12 +29,16 @@ PLATFORMS
|
|
36
29
|
ruby
|
37
30
|
|
38
31
|
DEPENDENCIES
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
32
|
+
bluecloth (~> 2.1.0)
|
33
|
+
fastercsv (~> 1.5.4)
|
34
|
+
myrrha (~> 1.2.0)
|
35
|
+
quickl (~> 0.4.0)
|
43
36
|
rake (~> 0.9.2)
|
44
37
|
rcov (~> 0.9.9)
|
38
|
+
redcarpet (~> 1.17.2)
|
39
|
+
request-log-analyzer (~> 1.11.0)
|
45
40
|
rspec (~> 2.6.0)
|
46
|
-
|
41
|
+
sequel (~> 3.25.0)
|
42
|
+
sqlite3 (~> 1.3.0)
|
43
|
+
wlang (~> 0.10.2)
|
47
44
|
yard (~> 0.7.2)
|
data/LICENCE.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT Licence
|
2
2
|
|
3
|
-
Copyright (c) 2011 - Bernard Lambeau
|
3
|
+
Copyright (c) 2011 - Bernard Lambeau & The University of Louvain (Belgium)
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|