Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,47 @@
<thead>
<tr>
<th>
<span data-toggle="tooltip" data-placement="right" title="ID of the application.">
<span data-toggle="tooltip" data-placement="top" title="ID of this application.">
App ID
</span>
</th>
<th>
<span data-toggle="tooltip" data-placement="above" title="Name of the application.">
<span data-toggle="tooltip" data-placement="top" title="Name of this application.">
App Name
</span>
</th>
<th class="attemptIDSpan">
<span data-toggle="tooltip" data-placement="above" title="The attempt ID of this application since one application might be launched several times">
<span data-toggle="tooltip" data-placement="top" title="The attempt ID of this application since one application might be launched several times">
Attempt ID
</span>
</th>
<th>
<span data-toggle="tooltip" data-placement="right" title="Started time of this application.">
<span data-toggle="tooltip" data-placement="top" title="Started time of this application.">
Started
</span>
</th>
<th class="completedColumn">
<span data-toggle="tooltip" data-placement="above" title="The completed time of this application.">
<span data-toggle="tooltip" data-placement="top" title="The completed time of this application.">
Completed
</span>
</th>
<th>
<span data-toggle="tooltip" data-placement="above" title="The duration time of this application.">
<span data-toggle="tooltip" data-placement="top" title="The duration time of this application.">
Duration
</span>
</th>
<th>
<span data-toggle="tooltip" data-placement="right" title="The Spark user of this application">
<span data-toggle="tooltip" data-placement="top" title="The Spark user of this application">
Spark User
</span>
</th>
<th>
<span data-toggle="tooltip" data-placement="above" title="The timestamp of the last updating on this application">
<span data-toggle="tooltip" data-placement="top" title="The timestamp of the last updating on this application">
Last Updated
</span>
</th>
<th>
<span data-toggle="tooltip" data-placement="above" title="Download the event log for this application">
<span data-toggle="tooltip" data-placement="top" title="Download the event log for this application">
Event Log
</span>
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ $(document).ready(function() {
}

$(selector).DataTable(conf);
$('#hisotry-summary [data-toggle="tooltip"]').tooltip();
$('#history-summary [data-toggle="tooltip"]').tooltip();
});
});
});
14 changes: 12 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/jobs/UIData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ package org.apache.spark.ui.jobs
import scala.collection.mutable
import scala.collection.mutable.{HashMap, LinkedHashMap}

import com.google.common.collect.Interners

import org.apache.spark.JobExecutionStatus
import org.apache.spark.executor._
import org.apache.spark.scheduler.{AccumulableInfo, TaskInfo}
Expand Down Expand Up @@ -141,6 +143,14 @@ private[spark] object UIData {
}

object TaskUIData {

private val stringInterner = Interners.newWeakInterner[String]()

/** String interning to reduce the memory usage. */
private def weakIntern(s: String): String = {
stringInterner.intern(s)
}

def apply(taskInfo: TaskInfo): TaskUIData = {
new TaskUIData(dropInternalAndSQLAccumulables(taskInfo))
}
Expand All @@ -155,8 +165,8 @@ private[spark] object UIData {
index = taskInfo.index,
attemptNumber = taskInfo.attemptNumber,
launchTime = taskInfo.launchTime,
executorId = taskInfo.executorId,
host = taskInfo.host,
executorId = weakIntern(taskInfo.executorId),
host = weakIntern(taskInfo.host),
taskLocality = taskInfo.taskLocality,
speculative = taskInfo.speculative
)
Expand Down
4 changes: 2 additions & 2 deletions dev/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
SPARK_ROOT_DIR="$(dirname "$SCRIPT_DIR")"
# Exclude auto-geneated configuration file.
PATHS_TO_CHECK="$( cd "$SPARK_ROOT_DIR" && find . -name "*.py" -not -path "*python/docs/conf.py" )"
PATHS_TO_CHECK="$( cd "$SPARK_ROOT_DIR" && find . -name "*.py" )"
PEP8_REPORT_PATH="$SPARK_ROOT_DIR/dev/pep8-report.txt"
PYLINT_REPORT_PATH="$SPARK_ROOT_DIR/dev/pylint-report.txt"
PYLINT_INSTALL_INFO="$SPARK_ROOT_DIR/dev/pylint-info.txt"
Expand Down Expand Up @@ -64,7 +64,7 @@ export "PATH=$PYTHONPATH:$PATH"
#+ first, but we do so so that the check status can
#+ be output before the report, like with the
#+ scalastyle and RAT checks.
python "$PEP8_SCRIPT_PATH" --ignore=E402,E731,E241,W503,E226 --config=dev/tox.ini $PATHS_TO_CHECK >> "$PEP8_REPORT_PATH"
python "$PEP8_SCRIPT_PATH" --config=dev/tox.ini $PATHS_TO_CHECK >> "$PEP8_REPORT_PATH"
pep8_status="${PIPESTATUS[0]}"

if [ "$compile_status" -eq 0 -a "$pep8_status" -eq 0 ]; then
Expand Down
3 changes: 2 additions & 1 deletion dev/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
# limitations under the License.

[pep8]
ignore=E402,E731,E241,W503,E226
max-line-length=100
exclude=cloudpickle.py,heapq3.py,shared.py
exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ querySpecification
(RECORDREADER recordReader=STRING)?
fromClause?
(WHERE where=booleanExpression)?)
| ((kind=SELECT hint? setQuantifier? namedExpressionSeq fromClause?
| ((kind=SELECT (hints+=hint)* setQuantifier? namedExpressionSeq fromClause?
| fromClause (kind=SELECT setQuantifier? namedExpressionSeq)?)
lateralView*
(WHERE where=booleanExpression)?
Expand All @@ -381,12 +381,12 @@ querySpecification
;

hint
: '/*+' hintStatement '*/'
: '/*+' hintStatements+=hintStatement (','? hintStatements+=hintStatement)* '*/'
;

hintStatement
: hintName=identifier
| hintName=identifier '(' parameters+=identifier (',' parameters+=identifier)* ')'
| hintName=identifier '(' parameters+=primaryExpression (',' parameters+=primaryExpression)* ')'
;

fromClause
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark.sql.catalyst.analysis

import java.util.Locale

import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.catalyst.rules.Rule
import org.apache.spark.sql.catalyst.trees.CurrentOrigin
Expand Down Expand Up @@ -91,7 +92,12 @@ object ResolveHints {
ResolvedHint(h.child, HintInfo(isBroadcastable = Option(true)))
} else {
// Otherwise, find within the subtree query plans that should be broadcasted.
applyBroadcastHint(h.child, h.parameters.toSet)
applyBroadcastHint(h.child, h.parameters.map {
case tableName: String => tableName
case tableId: UnresolvedAttribute => tableId.name
case unsupported => throw new AnalysisException("Broadcast hint parameter should be " +
s"an identifier or string but was $unsupported (${unsupported.getClass}")
}.toSet)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ package object dsl {

def analyze: LogicalPlan =
EliminateSubqueryAliases(analysis.SimpleAnalyzer.execute(logicalPlan))

def hint(name: String, parameters: Any*): LogicalPlan =
UnresolvedHint(name, parameters, logicalPlan)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging
val withWindow = withDistinct.optionalMap(windows)(withWindows)

// Hint
withWindow.optionalMap(hint)(withHints)
hints.asScala.foldRight(withWindow)(withHints)
}
}

Expand Down Expand Up @@ -533,13 +533,16 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging
}

/**
* Add a [[UnresolvedHint]] to a logical plan.
* Add [[UnresolvedHint]]s to a logical plan.
*/
private def withHints(
ctx: HintContext,
query: LogicalPlan): LogicalPlan = withOrigin(ctx) {
val stmt = ctx.hintStatement
UnresolvedHint(stmt.hintName.getText, stmt.parameters.asScala.map(_.getText), query)
var plan = query
ctx.hintStatements.asScala.reverse.foreach { case stmt =>
plan = UnresolvedHint(stmt.hintName.getText, stmt.parameters.asScala.map(expression), plan)
}
plan
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ import org.apache.spark.sql.internal.SQLConf
/**
* A general hint for the child that is not yet resolved. This node is generated by the parser and
* should be removed This node will be eliminated post analysis.
* A pair of (name, parameters).
* @param name the name of the hint
* @param parameters the parameters of the hint
* @param child the [[LogicalPlan]] on which this hint applies
*/
case class UnresolvedHint(name: String, parameters: Seq[String], child: LogicalPlan)
case class UnresolvedHint(name: String, parameters: Seq[Any], child: LogicalPlan)
extends UnaryNode {

override lazy val resolved: Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ object SQLConf {
.createWithDefault(true)

val COLUMN_NAME_OF_CORRUPT_RECORD = buildConf("spark.sql.columnNameOfCorruptRecord")
.doc("The name of internal column for storing raw/un-parsed JSON records that fail to parse.")
.doc("The name of internal column for storing raw/un-parsed JSON and CSV records that fail " +
"to parse.")
.stringConf
.createWithDefault("_corrupt_record")

Expand Down Expand Up @@ -535,8 +536,7 @@ object SQLConf {

val IGNORE_CORRUPT_FILES = buildConf("spark.sql.files.ignoreCorruptFiles")
.doc("Whether to ignore corrupt files. If true, the Spark jobs will continue to run when " +
"encountering corrupted or non-existing and contents that have been read will still be " +
"returned.")
"encountering corrupted files and the contents that have been read will still be returned.")
.booleanConf
.createWithDefault(false)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.spark.sql

import org.apache.spark.sql.catalyst.analysis.AnalysisTest
import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.catalyst.dsl.plans._
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.logical._

class DSLHintSuite extends AnalysisTest {
lazy val a = 'a.int
lazy val b = 'b.string
lazy val c = 'c.string
lazy val r1 = LocalRelation(a, b, c)

test("various hint parameters") {
comparePlans(
r1.hint("hint1"),
UnresolvedHint("hint1", Seq(), r1)
)

comparePlans(
r1.hint("hint1", 1, "a"),
UnresolvedHint("hint1", Seq(1, "a"), r1)
)

comparePlans(
r1.hint("hint1", 1, $"a"),
UnresolvedHint("hint1", Seq(1, $"a"), r1)
)

comparePlans(
r1.hint("hint1", Seq(1, 2, 3), Seq($"a", $"b", $"c")),
UnresolvedHint("hint1", Seq(Seq(1, 2, 3), Seq($"a", $"b", $"c")), r1)
)
}
}
Loading