Skip to content

Commit

Permalink
fix the head notation of package object dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfei committed May 4, 2014
1 parent 394d8cb commit 66ff53b
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,33 @@ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.catalyst.plans.{Inner, JoinType}
import org.apache.spark.sql.catalyst.types._

/**
* A collection of implicit conversions that create a DSL for constructing catalyst data structures.
*
* {{{
* scala> import catalyst.dsl._
* scala> import org.apache.spark.sql.catalyst.dsl.expressions._
*
* // Standard operators are added to expressions.
* scala> import org.apache.spark.sql.catalyst.expressions.Literal
* scala> Literal(1) + Literal(1)
* res1: catalyst.expressions.Add = (1 + 1)
* res0: org.apache.spark.sql.catalyst.expressions.Add = (1 + 1)
*
* // There is a conversion from 'symbols to unresolved attributes.
* scala> 'a.attr
* res2: catalyst.analysis.UnresolvedAttribute = 'a
* res1: org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute = 'a
*
* // These unresolved attributes can be used to create more complicated expressions.
* scala> 'a === 'b
* res3: catalyst.expressions.Equals = ('a = 'b)
* res2: org.apache.spark.sql.catalyst.expressions.Equals = ('a = 'b)
*
* // SQL verbs can be used to construct logical query plans.
* scala> TestRelation('key.int, 'value.string).where('key === 1).select('value).analyze
* res4: catalyst.plans.logical.LogicalPlan =
* Project {value#1}
* Filter (key#0 = 1)
* TestRelation {key#0,value#1}
* scala> import org.apache.spark.sql.catalyst.plans.logical._
* scala> import org.apache.spark.sql.catalyst.dsl.plans._
* scala> LocalRelation('key.int, 'value.string).where('key === 1).select('value).analyze
* res3: org.apache.spark.sql.catalyst.plans.logical.LogicalPlan =
* Project [value#3]
* Filter (key#2 = 1)
* LocalRelation [key#2,value#3], []
* }}}
*/
package object dsl {
Expand Down

0 comments on commit 66ff53b

Please sign in to comment.