lib/alf/operator/relational/project.rb in alf-0.10.1 vs lib/alf/operator/relational/project.rb in alf-0.11.0
- old
+ new
@@ -1,22 +1,22 @@
module Alf
- module Operator::Relational
- class Project < Alf::Operator()
- include Operator::Relational, Operator::Shortcut, Operator::Unary
-
- signature do |s|
- s.argument :attributes, AttrList, []
- s.option :allbut, Boolean, false, 'Project all but specified attributes?'
- end
-
- protected
-
- # (see Operator::Shortcut#longexpr)
- def longexpr
- chain Operator::NonRelational::Compact.new,
- Operator::NonRelational::Clip.new(@attributes, {:allbut => @allbut}),
- datasets
- end
-
- end # class Project
- end # module Operator::Relational
+ module Operator
+ module Relational
+ class Project
+ include Relational, Unary
+
+ signature do |s|
+ s.argument :attributes, AttrList, []
+ s.option :allbut, Boolean, false, 'Project all but specified attributes?'
+ end
+
+ # (see Operator#compile)
+ def compile
+ op = Engine::Clip.new(operand, attributes, allbut)
+ op = Engine::Compact.new(op)
+ op
+ end
+
+ end # class Project
+ end # module Relational
+ end # module Operator
end # module Alf