Skip to content
Permalink
Browse files

[MINOR] Typo fixes

## What changes were proposed in this pull request?

Typo fixes

## How was this patch tested?

Local build / Doc-only changes

Author: Jacek Laskowski <jacek@japila.pl>

Closes #20344 from jaceklaskowski/typo-fixes.

(cherry picked from commit 76b8b84)
Signed-off-by: Sean Owen <sowen@cloudera.com>
  • Loading branch information...
jaceklaskowski authored and srowen committed Jan 22, 2018
1 parent 6facc7f commit 566ef93a672aea1803d6977883204780c2f6982d
Showing with 50 additions and 52 deletions.
  1. +1 −1 core/src/main/scala/org/apache/spark/SparkContext.scala
  2. +2 −2 external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala
  3. +1 −1 external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaWriteTask.scala
  4. +1 −1 sql/catalyst/src/main/java/org/apache/spark/sql/streaming/OutputMode.java
  5. +4 −4 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
  6. +1 −1 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
  7. +5 −7 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/interfaces.scala
  8. +1 −1 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanVisitor.scala
  9. +1 −1 ...ain/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/BasicStatsPlanVisitor.scala
  10. +2 −2 ...org/apache/spark/sql/catalyst/plans/logical/statsEstimation/SizeInBytesOnlyStatsPlanVisitor.scala
  11. +1 −1 sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
  12. +1 −1 sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
  13. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala
  14. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
  15. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
  16. +2 −2 sql/core/src/main/scala/org/apache/spark/sql/execution/command/SetCommand.scala
  17. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala
  18. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala
  19. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/OffsetSeq.scala
  20. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/OffsetSeqLog.scala
  21. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamingQueryWrapper.scala
  22. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStore.scala
  23. +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala
  24. +2 −2 sql/core/src/main/scala/org/apache/spark/sql/expressions/UserDefinedFunction.scala
  25. +2 −2 sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala
  26. +3 −3 sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala
  27. +1 −1 sql/core/src/test/resources/sql-tests/results/columnresolution-negative.sql.out
  28. +1 −1 sql/core/src/test/resources/sql-tests/results/columnresolution-views.sql.out
  29. +3 −3 sql/core/src/test/resources/sql-tests/results/columnresolution.sql.out
  30. +2 −2 sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
  31. +1 −1 sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
  32. +2 −2 sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
@@ -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>
@@ -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}")) {
@@ -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.")
}

@@ -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.
*/
@@ -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
@@ -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)
}
@@ -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.")
}
}

@@ -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:
@@ -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'")
}
}

@@ -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
@@ -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] {

@@ -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] {

@@ -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()
@@ -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 =
@@ -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 = {
@@ -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()."
)
}
@@ -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
@@ -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

@@ -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.")
}
@@ -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 = {
@@ -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. */
@@ -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
@@ -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
@@ -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`.
*/
@@ -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]
@@ -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))
@@ -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")) )
@@ -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) {
@@ -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(
@@ -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
@@ -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
@@ -195,7 +195,7 @@ SELECT t1.x.y.* FROM t1
struct<>
-- !query 22 output
org.apache.spark.sql.AnalysisException
cannot resolve 't1.x.y.*' give input columns 'i1';
cannot resolve 't1.x.y.*' given input columns 'i1';


-- !query 23
@@ -88,7 +88,7 @@ SELECT global_temp.view1.* FROM global_temp.view1
struct<>
-- !query 10 output
org.apache.spark.sql.AnalysisException
cannot resolve 'global_temp.view1.*' give input columns 'i1';
cannot resolve 'global_temp.view1.*' given input columns 'i1';


-- !query 11
@@ -179,7 +179,7 @@ SELECT mydb1.t1.* FROM mydb1.t1
struct<>
-- !query 21 output
org.apache.spark.sql.AnalysisException
cannot resolve 'mydb1.t1.*' give input columns 'i1';
cannot resolve 'mydb1.t1.*' given input columns 'i1';


-- !query 22
@@ -212,7 +212,7 @@ SELECT mydb1.t1.* FROM mydb1.t1
struct<>
-- !query 25 output
org.apache.spark.sql.AnalysisException
cannot resolve 'mydb1.t1.*' give input columns 'i1';
cannot resolve 'mydb1.t1.*' given input columns 'i1';


-- !query 26
@@ -420,7 +420,7 @@ SELECT mydb1.t5.* FROM mydb1.t5
struct<>
-- !query 50 output
org.apache.spark.sql.AnalysisException
cannot resolve 'mydb1.t5.*' give input columns 'i1, t5';
cannot resolve 'mydb1.t5.*' given input columns 'i1, t5';


-- !query 51
@@ -1896,12 +1896,12 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
var e = intercept[AnalysisException] {
sql("SELECT a.* FROM temp_table_no_cols a")
}.getMessage
assert(e.contains("cannot resolve 'a.*' give input columns ''"))
assert(e.contains("cannot resolve 'a.*' given input columns ''"))

e = intercept[AnalysisException] {
dfNoCols.select($"b.*")
}.getMessage
assert(e.contains("cannot resolve 'b.*' give input columns ''"))
assert(e.contains("cannot resolve 'b.*' given input columns ''"))
}
}

@@ -663,7 +663,7 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils {
}.getMessage
assert(e.contains("The depth of view `default`.`view0` exceeds the maximum view " +
"resolution depth (10). Analysis is aborted to avoid errors. Increase the value " +
"of spark.sql.view.maxNestedViewDepth to work aroud this."))
"of spark.sql.view.maxNestedViewDepth to work around this."))
}

val e = intercept[IllegalArgumentException] {
@@ -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.
*/

0 comments on commit 566ef93

Please sign in to comment.
You can’t perform that action at this time.