Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adressed Erwin comments on operators

  • Loading branch information...
commit ba1b19c0180ac2e48e493538c356739f87c236c5 1 parent c64dadc
@blambeau blambeau authored
View
6 doc/gh-pages/templates/menu/ruby.wtpl
@@ -1,9 +1,9 @@
<div class="subentry">Relational operators</div>
-<<+{oplist.wtpl share all with ops: main.relational_operators(true), categ: 'ruby'}
+<<+{oplist.wtpl share all with ops: main.relational_operators, categ: 'ruby'}
<div class="subentry">Experimental operators</div>
-<<+{oplist.wtpl share all with ops: main.experimental_operators(true), categ: 'ruby'}
+<<+{oplist.wtpl share all with ops: main.experimental_operators, categ: 'ruby'}
<div class="subentry">Non-relational operators</div>
-<<+{oplist.wtpl share all with ops: main.non_relational_operators(true), categ: 'ruby'}
+<<+{oplist.wtpl share all with ops: main.non_relational_operators, categ: 'ruby'}
View
8 doc/gh-pages/templates/menu/shell.wtpl
@@ -1,12 +1,12 @@
<div class="subentry">Relational operators</div>
-<<+{oplist.wtpl share all with ops: main.relational_operators(true), categ: 'shell'}
+<<+{oplist.wtpl share all with ops: main.relational_operators, categ: 'shell'}
<div class="subentry">Experimental operators</div>
-<<+{oplist.wtpl share all with ops: main.experimental_operators(true), categ: 'shell'}
+<<+{oplist.wtpl share all with ops: main.experimental_operators, categ: 'shell'}
<div class="subentry">Non-relational operators</div>
-<<+{oplist.wtpl share all with ops: main.non_relational_operators(true), categ: 'shell'}
+<<+{oplist.wtpl share all with ops: main.non_relational_operators, categ: 'shell'}
<div class="subentry">Other commands</div>
-<<+{oplist.wtpl share all with ops: main.other_non_relational_commands(true), categ: 'shell'}
+<<+{oplist.wtpl share all with ops: main.other_non_relational_commands, categ: 'shell'}
View
9 doc/gh-pages/use-cases/using-alf-to-analyze-logs.md
@@ -3,6 +3,7 @@
So, let first see if everything is ok. To check that Alf correctly recognizes the log file, we just ask him to show it as a relation. The `--pretty` option helper here keeping stuff readable by enabling wrapping and paging of the output:
<pre><code class="terminal">$ alf show --pretty access.log
+
+-----------------+-----------------+-------+----------------+--------------+...
| :remote_host | :remote_logname | :user | :timestamp | :http_method |...
+-----------------+-----------------+-------+----------------+--------------+...
@@ -18,7 +19,13 @@ Looks fine so far, except that some attributes have no value (nil is not a value
So, what are all available attributes?
-<pre><code class="terminal">$ alf heading access.log | alf show</code></pre>
+<pre><code class="terminal">$ alf heading access.log
+
+{:remote_host => String, :remote_logname => NilClass, :user => NilClass,
+ :timestamp => Bignum, :http_method => String, :path => String,
+ :http_version => String, :http_status => Fixnum, :bytes_sent => Fixnum,
+ :line_type => Symbol, :lineno => Fixnum, :source => NilClass}
+</code></pre>
View
7 doc/operators/relational/join.md
@@ -9,9 +9,10 @@ DESCRIPTION
This operator computes the (natural) join of its operands.
-Natural join means that, unlike what is commonly used in SQL, the join is
-performed on common attribute names. You can use the `rename` operator if this
-behavior does not fit your needs.
+Natural join means that, unlike what is commonly used in SQL, joining is based
+on equality of all attributes that are shared between LEFT and RIGHT performed
+on common attribute names. You can use the `rename` operator if this behavior
+does not fit your needs.
When operands have no attribute in common, this operator naturally "degenerates"
to a cartesian product.
View
10 doc/operators/relational/matching.md
@@ -7,12 +7,16 @@ SYNOPSIS
DESCRIPTION
-This operator restricts its LEFT operand to tuples for which there exists
-at least one tuple in RIGHT that (naturally) joins. This is a shortcut
-operator for the following longer expression:
+This operator restricts its LEFT operand to tuples for which there exists at
+least one tuple in RIGHT that (naturally) joins. This is a shortcut operator
+for the following longer expression:
(project (join xxx, yyy), [xxx's attributes])
+Or equivalently,
+
+ (join xxx, (project xxx, [common attributes]))
+
EXAMPLE
# Which suppliers supply at least one part?
View
4 doc/operators/relational/restrict.md
@@ -7,8 +7,8 @@ SYNOPSIS
DESCRIPTION
-This command restricts tuples to those for which PREDICATE evaluates to
-true.
+This command restricts restricts relations to those tuples for which PREDICATE
+evaluates to true.
PREDICATE must be a valid tuple expression that returns a truth-value. It
may be specified as a ruby code literal, or a mapping between (name, value)
View
16 lib/alf.rb
@@ -264,23 +264,29 @@ def self.each
# Marker module and namespace for relational operators
#
module Relational
- require 'alf/operator/relational/project'
require 'alf/operator/relational/extend'
- require 'alf/operator/relational/rename'
+ require 'alf/operator/relational/project'
require 'alf/operator/relational/restrict'
- require 'alf/operator/relational/join'
- require 'alf/operator/relational/intersect'
- require 'alf/operator/relational/minus'
+ require 'alf/operator/relational/rename'
+
require 'alf/operator/relational/union'
+ require 'alf/operator/relational/minus'
+ require 'alf/operator/relational/intersect'
+ require 'alf/operator/relational/join'
+
require 'alf/operator/relational/matching'
require 'alf/operator/relational/not_matching'
+
require 'alf/operator/relational/wrap'
require 'alf/operator/relational/unwrap'
+
require 'alf/operator/relational/group'
require 'alf/operator/relational/ungroup'
+
require 'alf/operator/relational/summarize'
require 'alf/operator/relational/rank'
require 'alf/operator/relational/quota'
+
require 'alf/operator/relational/heading'
#
View
1  lib/alf/operator/relational/heading.rb
@@ -2,6 +2,7 @@ module Alf
module Operator::Relational
class Heading < Alf::Operator()
include Operator::Relational,
+ Operator::Experimental,
Operator::Unary
signature do |s|
View
11 spec/integration/command/alf/alf_help.stdout
@@ -25,14 +25,14 @@ OPTIONS
RELATIONAL OPERATORS
- project Relational projection (clip + compact)
extend Relational extension (additional, computed attributes)
- rename Relational renaming (rename some attributes)
+ project Relational projection (clip + compact)
restrict Relational restriction (aka where, predicate filtering)
- join Relational join (and cartesian product)
- intersect Relational intersection (aka a logical and)
- minus Relational minus (aka difference)
+ rename Relational renaming (rename some attributes)
union Relational union
+ minus Relational minus (aka difference)
+ intersect Relational intersection (aka a logical and)
+ join Relational join (and cartesian product)
matching Relational matching (join + project back on left)
not-matching Relational not matching (inverse of matching)
wrap Relational wrapping (tuple-valued attributes)
@@ -41,6 +41,7 @@ RELATIONAL OPERATORS
ungroup Relational un-grouping (inverse of group)
summarize Relational summarization (group-by + aggregate ops)
rank Relational ranking (explicit tuple positions)
+ heading Sorry, no documentation available for heading
EXPERIMENTAL RELATIONAL OPERATORS
View
1  spec/integration/command/help/help_1.stdout
@@ -11,6 +11,7 @@ OPTIONS
--text Render output as a text table
--yaml Render output as a yaml output
--csv Render output as a csv file
+ --[no-]pretty Enable/disable pretty print based on console inference
DESCRIPTION
View
3  spec/unit/operator/test_relational.rb
@@ -8,6 +8,7 @@ module Alf
x.sort{|m1,m2| m1.name.to_s <=> m2.name.to_s}.should == [
Alf::Operator::Relational::Extend,
Alf::Operator::Relational::Group,
+ Alf::Operator::Relational::Heading,
Alf::Operator::Relational::Intersect,
Alf::Operator::Relational::Join,
Alf::Operator::Relational::Matching,
@@ -27,4 +28,4 @@ module Alf
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.