Skip to content

Commit

Permalink
Unified package definition format in Spark SQL
Browse files Browse the repository at this point in the history
According to discussions in comments of PR apache#208, this PR unifies package definition format in Spark SQL.

Some broken links in ScalaDoc and typos detected along the way are also fixed.

Author: Cheng Lian <[email protected]>

Closes apache#225 from liancheng/packageDefinition and squashes the following commits:

75c47b3 [Cheng Lian] Fixed file line length
4f87968 [Cheng Lian] Unified package definition format in Spark SQL
  • Loading branch information
liancheng authored and pdeyhim committed Jun 25, 2014
1 parent 529e6f2 commit e605b1b
Show file tree
Hide file tree
Showing 103 changed files with 209 additions and 333 deletions.
5 changes: 3 additions & 2 deletions core/src/main/scala/org/apache/spark/Dependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ abstract class NarrowDependency[T](rdd: RDD[T]) extends Dependency(rdd) {
* Represents a dependency on the output of a shuffle stage.
* @param rdd the parent RDD
* @param partitioner partitioner used to partition the shuffle output
* @param serializer [[Serializer]] to use. If set to null, the default serializer, as specified
* by `spark.serializer` config option, will be used.
* @param serializer [[org.apache.spark.serializer.Serializer Serializer]] to use. If set to null,
* the default serializer, as specified by `spark.serializer` config option, will
* be used.
*/
class ShuffleDependency[K, V](
@transient rdd: RDD[_ <: Product2[K, V]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable {
/**
* Returns the maximum element from this RDD as defined by the specified
* Comparator[T].
* @params comp the comparator that defines ordering
* @param comp the comparator that defines ordering
* @return the maximum of the RDD
* */
def max(comp: Comparator[T]): T = {
Expand All @@ -491,7 +491,7 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable {
/**
* Returns the minimum element from this RDD as defined by the specified
* Comparator[T].
* @params comp the comparator that defines ordering
* @param comp the comparator that defines ordering
* @return the minimum of the RDD
* */
def min(comp: Comparator[T]): T = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package org.apache.spark.sql.catalyst

import org.apache.spark.sql.catalyst.expressions.Attribute
import org.apache.spark.sql.catalyst.expressions.AttributeReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package analysis
package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.logical._
Expand Down Expand Up @@ -89,7 +87,8 @@ class Analyzer(catalog: Catalog, registry: FunctionRegistry, caseSensitive: Bool

/**
* Replaces [[UnresolvedAttribute]]s with concrete
* [[expressions.AttributeReference AttributeReferences]] from a logical plan node's children.
* [[catalyst.expressions.AttributeReference AttributeReferences]] from a logical plan node's
* children.
*/
object ResolveReferences extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
Expand All @@ -106,7 +105,7 @@ class Analyzer(catalog: Catalog, registry: FunctionRegistry, caseSensitive: Bool
}

/**
* Replaces [[UnresolvedFunction]]s with concrete [[expressions.Expression Expressions]].
* Replaces [[UnresolvedFunction]]s with concrete [[catalyst.expressions.Expression Expressions]].
*/
object ResolveFunctions extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package analysis
package org.apache.spark.sql.catalyst.analysis

import scala.collection.mutable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package analysis
package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.expressions.Expression

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package analysis
package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, Union}
Expand All @@ -37,8 +35,8 @@ trait HiveTypeCoercion {
StringToIntegralCasts, FunctionArgumentConversion)

/**
* Applies any changes to [[catalyst.expressions.AttributeReference AttributeReference]] dataTypes
* that are made by other rules to instances higher in the query tree.
* Applies any changes to [[catalyst.expressions.AttributeReference AttributeReference]] data
* types that are made by other rules to instances higher in the query tree.
*/
object PropagateTypes extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql.catalyst
package analysis
package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.rules.Rule
import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package org.apache.spark.sql.catalyst

/**
* Provides a logical query plan [[Analyzer]] and supporting classes for performing analysis.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package analysis
package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.{errors, trees}
import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, Expression, NamedExpression}
import org.apache.spark.sql.catalyst.plans.logical.BaseRelation
import org.apache.spark.sql.catalyst.trees.TreeNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package org.apache.spark.sql.catalyst

import scala.language.implicitConversions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package org.apache.spark.sql.catalyst

import org.apache.spark.sql.catalyst.trees.TreeNode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.trees
import org.apache.spark.sql.catalyst.errors.attachTree
import org.apache.spark.sql.catalyst.plans.QueryPlan
import org.apache.spark.sql.catalyst.rules.Rule
import org.apache.spark.sql.Logging

/**
* A bound reference points to a specific slot in the input tuple, allowing the actual value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.trees
import org.apache.spark.sql.catalyst.errors.TreeNodeException
import org.apache.spark.sql.catalyst.trees.TreeNode
import org.apache.spark.sql.catalyst.types.{DataType, FractionalType, IntegralType, NumericType}
import org.apache.spark.sql.catalyst.errors.TreeNodeException

abstract class Expression extends TreeNode[Expression] {
self: Product =>
Expand Down Expand Up @@ -69,7 +68,7 @@ abstract class Expression extends TreeNode[Expression] {
def childrenResolved = !children.exists(!_.resolved)

/**
* A set of helper functions that return the correct descendant of [[scala.math.Numeric]] type
* A set of helper functions that return the correct descendant of `scala.math.Numeric[T]` type
* and do any casting necessary of child evaluation.
*/
@inline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql.catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

/**
* Converts a [[Row]] to another Row given a sequence of expression that define each column of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types.DoubleType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types.NativeType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types.DataType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

abstract sealed class SortDirection
case object Ascending extends SortDirection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import scala.language.dynamics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types._
import org.apache.spark.sql.catalyst.trees

abstract class AggregateExpression extends Expression {
self: Product =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.analysis.UnresolvedException
import org.apache.spark.sql.catalyst.types._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.trees
import org.apache.spark.sql.catalyst.types._

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.types._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.trees
import org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute
import org.apache.spark.sql.catalyst.types._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package expressions
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.sql.catalyst.trees
import org.apache.spark.sql.catalyst.analysis.UnresolvedException

case class Coalesce(children: Seq[Expression]) extends Expression {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

package org.apache.spark.sql
package catalyst
package org.apache.spark.sql.catalyst

/**
* A set of classes that can be used to represent trees of relational expressions. A key goal of
Expand Down Expand Up @@ -46,6 +45,6 @@ package catalyst
* ability to reason about which subquery produced a given attribute.
*
* ==Evaluation==
* The result of expressions can be evaluated using the [[Evaluate]] object.
* The result of expressions can be evaluated using the `Expression.apply(Row)` method.
*/
package object expressions
Loading

0 comments on commit e605b1b

Please sign in to comment.