Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR] Typo fixes #20344

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2276,7 +2276,7 @@ class SparkContext(config: SparkConf) extends Logging {
}

/**
* Clean a closure to make it ready to be serialized and send to tasks
* Clean a closure to make it ready to be serialized and sent to tasks
* (removes unreferenced variables in $outer's, updates REPL variables)
* If <tt>checkSerializable</tt> is set, <tt>clean</tt> will also proactively
* check to see if <tt>f</tt> is serializable and throw a <tt>SparkException</tt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
if (caseInsensitiveParams.contains(s"kafka.${ConsumerConfig.GROUP_ID_CONFIG}")) {
throw new IllegalArgumentException(
s"Kafka option '${ConsumerConfig.GROUP_ID_CONFIG}' is not supported as " +
s"user-specified consumer groups is not used to track offsets.")
s"user-specified consumer groups are not used to track offsets.")
}

if (caseInsensitiveParams.contains(s"kafka.${ConsumerConfig.AUTO_OFFSET_RESET_CONFIG}")) {
Expand Down Expand Up @@ -335,7 +335,7 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister
{
throw new IllegalArgumentException(
s"Kafka option '${ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG}' is not supported as "
+ "value are deserialized as byte arrays with ByteArrayDeserializer. Use DataFrame "
+ "values are deserialized as byte arrays with ByteArrayDeserializer. Use DataFrame "
+ "operations to explicitly deserialize the values.")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.apache.spark.sql.catalyst.expressions.{Attribute, Cast, Literal, Unsa
import org.apache.spark.sql.types.{BinaryType, StringType}

/**
* A simple trait for writing out data in a single Spark task, without any concerns about how
* Writes out data in a single Spark task, without any concerns about how
* to commit or abort tasks. Exceptions thrown by the implementation of this class will
* automatically trigger task aborts.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.spark.sql.catalyst.streaming.InternalOutputModes;

/**
* OutputMode is used to what data will be written to a streaming sink when there is
* OutputMode describes what data will be written to a streaming sink when there is
* new data available in a streaming DataFrame/Dataset.
*
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ class Analyzer(
if (AnalysisContext.get.nestedViewDepth > conf.maxNestedViewDepth) {
view.failAnalysis(s"The depth of view ${view.desc.identifier} exceeds the maximum " +
s"view resolution depth (${conf.maxNestedViewDepth}). Analysis is aborted to " +
"avoid errors. Increase the value of spark.sql.view.maxNestedViewDepth to work " +
"aroud this.")
s"avoid errors. Increase the value of ${SQLConf.MAX_NESTED_VIEW_DEPTH.key} to work " +
"around this.")
}
executeSameContext(child)
}
Expand Down Expand Up @@ -653,7 +653,7 @@ class Analyzer(
// Note that if the database is not defined, it is possible we are looking up a temp view.
case e: NoSuchDatabaseException =>
u.failAnalysis(s"Table or view not found: ${tableIdentWithDb.unquotedString}, the " +
s"database ${e.db} doesn't exsits.")
s"database ${e.db} doesn't exist.")
}
}

Expand Down Expand Up @@ -1222,7 +1222,7 @@ class Analyzer(
wf
}
// We get an aggregate function, we need to wrap it in an AggregateExpression.
case agg: AggregateFunction => AggregateExpression(agg, Complete, isDistinct)
case agg: AggregateFunction => agg.toAggregateExpression(isDistinct)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like a typo fix

// This function is not an aggregate function, just return the resolved one.
case other =>
if (isDistinct) {
Expand Down Expand Up @@ -1524,7 +1524,7 @@ class Analyzer(
}

/**
* Extracts [[Generator]] from the projectList of a [[Project]] operator and create [[Generate]]
* Extracts [[Generator]] from the projectList of a [[Project]] operator and creates [[Generate]]
* operator under [[Project]].
*
* This rule will throw [[AnalysisException]] for following cases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ case class UnresolvedGenerator(name: FunctionIdentifier, children: Seq[Expressio
override def prettyName: String = name.unquotedString
override def toString: String = s"'$name(${children.mkString(", ")})"

override def eval(input: InternalRow = null): TraversableOnce[InternalRow] =
override def eval(input: InternalRow = EmptyRow): TraversableOnce[InternalRow] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise this could be a functional change

throw new UnsupportedOperationException(s"Cannot evaluate expression: $this")

override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode =
Expand Down Expand Up @@ -294,7 +294,7 @@ case class UnresolvedStar(target: Option[Seq[String]]) extends Star with Unevalu
} else {
val from = input.inputSet.map(_.name).mkString(", ")
val targetString = target.get.mkString(".")
throw new AnalysisException(s"cannot resolve '$targetString.*' give input columns '$from'")
throw new AnalysisException(s"cannot resolve '$targetString.*' given input columns '$from'")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,15 @@ abstract class AggregateFunction extends Expression {
def defaultResult: Option[Literal] = None

/**
* Wraps this [[AggregateFunction]] in an [[AggregateExpression]] because
* [[AggregateExpression]] is the container of an [[AggregateFunction]], aggregation mode,
* and the flag indicating if this aggregation is distinct aggregation or not.
* An [[AggregateFunction]] should not be used without being wrapped in
* an [[AggregateExpression]].
* Creates [[AggregateExpression]] with `isDistinct` flag disabled.
*
* @see `toAggregateExpression(isDistinct: Boolean)` for detailed description
*/
def toAggregateExpression(): AggregateExpression = toAggregateExpression(isDistinct = false)

/**
* Wraps this [[AggregateFunction]] in an [[AggregateExpression]] and set isDistinct
* field of the [[AggregateExpression]] to the given value because
* Wraps this [[AggregateFunction]] in an [[AggregateExpression]] and sets `isDistinct`
* flag of the [[AggregateExpression]] to the given value because
* [[AggregateExpression]] is the container of an [[AggregateFunction]], aggregation mode,
* and the flag indicating if this aggregation is distinct aggregation or not.
* An [[AggregateFunction]] should not be used without being wrapped in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.spark.sql.catalyst.plans.logical

/**
* A visitor pattern for traversing a [[LogicalPlan]] tree and compute some properties.
* A visitor pattern for traversing a [[LogicalPlan]] tree and computing some properties.
*/
trait LogicalPlanVisitor[T] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package org.apache.spark.sql.catalyst.plans.logical.statsEstimation
import org.apache.spark.sql.catalyst.plans.logical._

/**
* An [[LogicalPlanVisitor]] that computes a the statistics used in a cost-based optimizer.
* A [[LogicalPlanVisitor]] that computes the statistics for the cost-based optimizer.
*/
object BasicStatsPlanVisitor extends LogicalPlanVisitor[Statistics] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ object SizeInBytesOnlyStatsPlanVisitor extends LogicalPlanVisitor[Statistics] {
}

/**
* For leaf nodes, use its computeStats. For other nodes, we assume the size in bytes is the
* sum of all of the children's.
* For leaf nodes, use its `computeStats`. For other nodes, we assume the size in bytes is the
* product of all of the children's `computeStats`.
*/
override def default(p: LogicalPlan): Statistics = p match {
case p: LeafNode => p.computeStats()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ object SQLConf {
.internal()
.doc("The number of bins when generating histograms.")
.intConf
.checkValue(num => num > 1, "The number of bins must be large than 1.")
.checkValue(num => num > 1, "The number of bins must be larger than 1.")
.createWithDefault(254)

val PERCENTILE_ACCURACY =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ trait PlanTestBase extends PredicateHelper { self: Suite =>
}

/**
* Sets all SQL configurations specified in `pairs`, calls `f`, and then restore all SQL
* Sets all SQL configurations specified in `pairs`, calls `f`, and then restores all SQL
* configurations.
*/
protected def withSQLConf(pairs: (String, String)*)(f: => Unit): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) {
if (partitioningColumns.isDefined) {
throw new AnalysisException(
"insertInto() can't be used together with partitionBy(). " +
"Partition columns have already be defined for the table. " +
"Partition columns have already been defined for the table. " +
"It is not necessary to use partitionBy()."
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {
}

/**
* Create a [[DescribeTableCommand]] logical plan.
* Create a [[DescribeColumnCommand]] or [[DescribeTableCommand]] logical commands.
*/
override def visitDescribeTable(ctx: DescribeTableContext): LogicalPlan = withOrigin(ctx) {
val isExtended = ctx.EXTENDED != null || ctx.FORMATTED != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ trait CodegenSupport extends SparkPlan {
}

/**
* Whether this SparkPlan support whole stage codegen or not.
* Whether this SparkPlan supports whole stage codegen or not.
*/
def supportCodegen: Boolean = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ case class SetCommand(kv: Option[(String, Option[String])]) extends RunnableComm
if (sparkSession.conf.get(CATALOG_IMPLEMENTATION.key).equals("hive") &&
key.startsWith("hive.")) {
logWarning(s"'SET $key=$value' might not work, since Spark doesn't support changing " +
"the Hive config dynamically. Please passing the Hive-specific config by adding the " +
s"prefix spark.hadoop (e.g., spark.hadoop.$key) when starting a Spark application. " +
"the Hive config dynamically. Please pass the Hive-specific config by adding the " +
s"prefix spark.hadoop (e.g. spark.hadoop.$key) when starting a Spark application. " +
"For details, see the link: https://spark.apache.org/docs/latest/configuration.html#" +
"dynamically-loading-spark-properties.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.apache.spark.sql.types.{AtomicType, StructType}
import org.apache.spark.sql.util.SchemaUtils

/**
* Try to replaces [[UnresolvedRelation]]s if the plan is for direct query on files.
* Replaces [[UnresolvedRelation]]s if the plan is for direct query on files.
*/
class ResolveSQLOnFile(sparkSession: SparkSession) extends Rule[LogicalPlan] {
private def maybeSQLFile(u: UnresolvedRelation): Boolean = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ object HDFSMetadataLog {
/** A simple trait to abstract out the file management operations needed by HDFSMetadataLog. */
trait FileManager {

/** List the files in a path that matches a filter. */
/** List the files in a path that match a filter. */
def list(path: Path, filter: PathFilter): Array[FileStatus]

/** Make directory at the give path and all its parent directories as needed. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.apache.spark.sql.internal.SQLConf.{SHUFFLE_PARTITIONS, STATE_STORE_PR
case class OffsetSeq(offsets: Seq[Option[Offset]], metadata: Option[OffsetSeqMetadata] = None) {

/**
* Unpacks an offset into [[StreamProgress]] by associating each offset with the order list of
* Unpacks an offset into [[StreamProgress]] by associating each offset with the ordered list of
* sources.
*
* This method is typically used to associate a serialized offset with actual sources (which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.apache.spark.sql.SparkSession
/**
* This class is used to log offsets to persistent files in HDFS.
* Each file corresponds to a specific batch of offsets. The file
* format contain a version string in the first line, followed
* format contains a version string in the first line, followed
* by a the JSON string representation of the offsets separated
* by a newline character. If a source offset is missing, then
* that line will contain a string value defined in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.streaming.{StreamingQuery, StreamingQueryException, StreamingQueryProgress, StreamingQueryStatus}

/**
* Wrap non-serializable StreamExecution to make the query serializable as it's easy to for it to
* Wrap non-serializable StreamExecution to make the query serializable as it's easy for it to
* get captured with normal usage. It's safe to capture the query but not use it in executors.
* However, if the user tries to call its methods, it will throw `IllegalStateException`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ trait StateStore {
def abort(): Unit

/**
* Return an iterator containing all the key-value pairs in the SateStore. Implementations must
* Return an iterator containing all the key-value pairs in the StateStore. Implementations must
* ensure that updates (puts, removes) can be made while iterating over this iterator.
*/
def iterator(): Iterator[UnsafeRowPair]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ExecutionPage(parent: SQLTab) extends WebUIPage("execution") with Logging
planVisualization(metrics, graph) ++
physicalPlanDescription(executionUIData.physicalPlanDescription)
}.getOrElse {
<div>No information to display for Plan {executionId}</div>
<div>No information to display for query {executionId}</div>
}

UIUtils.headerSparkPage(s"Details for Query $executionId", content, parent, Some(5000))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import org.apache.spark.sql.types.DataType
*
* As an example:
* {{{
* // Defined a UDF that returns true or false based on some numeric score.
* val predict = udf((score: Double) => if (score > 0.5) true else false)
* // Define a UDF that returns true or false based on some numeric score.
* val predict = udf((score: Double) => score > 0.5)
*
* // Projects a column that adds a prediction column based on the score column.
* df.select( predict(df("score")) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ abstract class BaseSessionStateBuilder(
/**
* Logical query plan optimizer.
*
* Note: this depends on the `conf`, `catalog` and `experimentalMethods` fields.
* Note: this depends on `catalog` and `experimentalMethods` fields.
*/
protected def optimizer: Optimizer = {
new SparkOptimizer(catalog, experimentalMethods) {
Expand Down Expand Up @@ -263,7 +263,7 @@ abstract class BaseSessionStateBuilder(
* An interface to register custom [[org.apache.spark.sql.util.QueryExecutionListener]]s
* that listen for execution metrics.
*
* This gets cloned from parent if available, otherwise is a new instance is created.
* This gets cloned from parent if available, otherwise a new instance is created.
*/
protected def listenerManager: ExecutionListenerManager = {
parentState.map(_.listenerManager.clone()).getOrElse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ final class DataStreamReader private[sql](sparkSession: SparkSession) extends Lo
* You can set the following option(s):
* <ul>
* <li>`timeZone` (default session local timezone): sets the string that indicates a timezone
* to be used to parse timestamps in the JSON/CSV datasources or partition values.</li>
* to be used to parse timestamps in the JSON/CSV data sources or partition values.</li>
* </ul>
*
* @since 2.0.0
Expand All @@ -129,12 +129,12 @@ final class DataStreamReader private[sql](sparkSession: SparkSession) extends Lo
}

/**
* Adds input options for the underlying data source.
* (Java-specific) Adds input options for the underlying data source.
*
* You can set the following option(s):
* <ul>
* <li>`timeZone` (default session local timezone): sets the string that indicates a timezone
* to be used to parse timestamps in the JSON/CSV datasources or partition values.</li>
* to be used to parse timestamps in the JSON/CSV data sources or partition values.</li>
* </ul>
*
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
}

/**
* Get the raw table metadata from hive metastore directly. The raw table metadata may contains
* special data source properties and should not be exposed outside of `HiveExternalCatalog`. We
* Get the raw table metadata from hive metastore directly. The raw table metadata may contain
* special data source properties that should not be exposed outside of `HiveExternalCatalog`. We
* should interpret these special data source properties and restore the original table metadata
* before returning it.
*/
Expand Down