Repository navigation
Conversation
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16233/ |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16235/ |
|
Merged build finished. All automated tests passed. |
|
All automated tests passed. |
Conflicts: core/src/test/scala/org/apache/spark/FailureSuite.scala
|
I brought this up to date. @andrewor14 can you take a look at this? I'd want to merge this quickly so I can submit my other scheduler patches too. |
|
QA tests have started for PR 1259. This patch merges cleanly. |
|
QA results for PR 1259: |
|
Hi @rxin, I took a pass over the patch and the changes mostly look good. On a higher level point, I notice that we log this pattern |
|
If we actually want people to get information out of all those numbers, can we consider using a human readable format such as (Do we actually need both task id and task index in general, by the way?) |
|
@andrewor14 the task id is not logged twice. One is TID, which is used to correlate with the executors (because executors only know about TID's), and the other is the task index, which is the index of the task within a stage. |
|
Task ID is globally unqiue, index is unique within a stage |
|
QA tests have started for PR 1259. This patch merges cleanly. |
|
Updated the PR. |
|
QA results for PR 1259: |
|
@andrewor14 PTAL. |
|
QA tests have started for PR 1259. This patch merges cleanly. |
|
QA results for PR 1259: |
|
LGTM |
|
Thanks. Merging this. We can fix the serialization error logging in a separate PR. |
We use TID to indicate task logging. However, TID itself does not capture stage or retries, making it harder to correlate with the application itself. This pull request changes all logging messages for tasks to include both the TID and the stage id, stage attempt, task id, and task attempt. I've consulted various people but unfortunately this is a really hard task. Driver log looks like: ``` 14/06/28 18:53:29 INFO DAGScheduler: Submitting 10 missing tasks from Stage 0 (MappedRDD[1] at map at <console>:13) 14/06/28 18:53:29 INFO TaskSchedulerImpl: Adding task set 0.0 with 10 tasks 14/06/28 18:53:29 INFO TaskSetManager: Re-computing pending task lists. 14/07/15 19:44:40 INFO TaskSetManager: Starting task 0.0 in stage 1.0 (TID 0, localhost, PROCESS_LOCAL, 1855 bytes) 14/07/15 19:44:40 INFO TaskSetManager: Starting task 1.0 in stage 1.0 (TID 1, localhost, PROCESS_LOCAL, 1855 bytes) 14/07/15 19:44:40 INFO TaskSetManager: Starting task 2.0 in stage 1.0 (TID 2, localhost, PROCESS_LOCAL, 1855 bytes) 14/07/15 19:44:40 INFO TaskSetManager: Starting task 3.0 in stage 1.0 (TID 3, localhost, PROCESS_LOCAL, 1855 bytes) 14/07/15 19:44:40 INFO TaskSetManager: Starting task 4.0 in stage 1.0 (TID 4, localhost, PROCESS_LOCAL, 1855 bytes) 14/07/15 19:44:40 INFO TaskSetManager: Starting task 5.0 in stage 1.0 (TID 5, localhost, PROCESS_LOCAL, 1855 bytes) 14/07/15 19:44:40 INFO TaskSetManager: Starting task 6.0 in stage 1.0 (TID 6, localhost, PROCESS_LOCAL, 1855 bytes) ... 14/07/15 19:44:40 INFO TaskSetManager: Finished task 1.0 in stage 1.0 (TID 1) in 64 ms on localhost (4/10) 14/07/15 19:44:40 INFO TaskSetManager: Finished task 4.0 in stage 1.0 (TID 4) in 63 ms on localhost (5/10) 14/07/15 19:44:40 INFO TaskSetManager: Finished task 2.0 in stage 1.0 (TID 2) in 63 ms on localhost (6/10) 14/07/15 19:44:40 INFO TaskSetManager: Finished task 7.0 in stage 1.0 (TID 7) in 62 ms on localhost (7/10) 14/07/15 19:44:40 INFO TaskSetManager: Finished task 6.0 in stage 1.0 (TID 6) in 63 ms on localhost (8/10) 14/07/15 19:44:40 INFO TaskSetManager: Finished task 9.0 in stage 1.0 (TID 9) in 8 ms on localhost (9/10) 14/07/15 19:44:40 INFO TaskSetManager: Finished task 8.0 in stage 1.0 (TID 8) in 9 ms on localhost (10/10) ``` Executor log looks like ``` 14/07/15 19:44:40 INFO Executor: Running task 0.0 in stage 1.0 (TID 0) 14/07/15 19:44:40 INFO Executor: Running task 3.0 in stage 1.0 (TID 3) 14/07/15 19:44:40 INFO Executor: Running task 1.0 in stage 1.0 (TID 1) 14/07/15 19:44:40 INFO Executor: Running task 4.0 in stage 1.0 (TID 4) 14/07/15 19:44:40 INFO Executor: Running task 2.0 in stage 1.0 (TID 2) 14/07/15 19:44:40 INFO Executor: Running task 5.0 in stage 1.0 (TID 5) 14/07/15 19:44:40 INFO Executor: Running task 6.0 in stage 1.0 (TID 6) 14/07/15 19:44:40 INFO Executor: Running task 7.0 in stage 1.0 (TID 7) 14/07/15 19:44:40 INFO Executor: Finished task 3.0 in stage 1.0 (TID 3). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 2.0 in stage 1.0 (TID 2). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 0.0 in stage 1.0 (TID 0). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 1.0 in stage 1.0 (TID 1). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 5.0 in stage 1.0 (TID 5). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 4.0 in stage 1.0 (TID 4). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 6.0 in stage 1.0 (TID 6). 847 bytes result sent to driver 14/07/15 19:44:40 INFO Executor: Finished task 7.0 in stage 1.0 (TID 7). 847 bytes result sent to driver ``` Author: Reynold Xin <rxin@apache.org> Closes apache#1259 from rxin/betterTaskLogging and squashes the following commits: c28ada1 [Reynold Xin] Fix unit test failure. 987d043 [Reynold Xin] Updated log messages. c6cfd46 [Reynold Xin] Merge branch 'master' into betterTaskLogging b7b1bcc [Reynold Xin] Fixed a typo. f9aba3c [Reynold Xin] Made it compile. f8a5c06 [Reynold Xin] Merge branch 'master' into betterTaskLogging 07264e6 [Reynold Xin] Defensive check against unknown TaskEndReason. 76bbd18 [Reynold Xin] FailureSuite not serializable reporting. 4659b20 [Reynold Xin] Remove unused variable. 53888e3 [Reynold Xin] [SPARK-2317] Improve task logging.
…xecutor ### What changes were proposed in this pull request? This PR replaces some arbitrary task names in logs with the widely used task name (e.g. "task 0.0 in stage 1.0 (TID 1)") among driver and executor. This will change the task name in `TaskDescription` by appending TID. ### Why are the changes needed? Some logs are still using TID(a.k.a `taskId`) only as the task name, e.g., https://github.com/apache/spark/blob/7f275ee5978e00ac514e25f5ef1d4e3331f8031b/core/src/main/scala/org/apache/spark/executor/Executor.scala#L786 https://github.com/apache/spark/blob/7f275ee5978e00ac514e25f5ef1d4e3331f8031b/core/src/main/scala/org/apache/spark/executor/Executor.scala#L632-L635 And the task thread name also only has the `taskId`: https://github.com/apache/spark/blob/7f275ee5978e00ac514e25f5ef1d4e3331f8031b/core/src/main/scala/org/apache/spark/executor/Executor.scala#L325 As mentioned in #1259, TID itself does not capture stage or retries, making it harder to correlate with the application. It's inconvenient when debugging applications. Actually, task name like "task name (e.g. "task 0.0 in stage 1.0 (TID 1)")" has already been used widely after #1259. We'd better follow the naming convention. ### Does this PR introduce _any_ user-facing change? Yes. Users will see the more consistent task names in the log. ### How was this patch tested? Manually checked. Closes #29418 from Ngone51/unify-task-name. Authored-by: yi.wu <yi.wu@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
### What changes were proposed in this pull request? This PR migrated to a released version of ADT. ### Why are the changes needed? These changes are needed to avoid depending on snapshots. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? N/A.
### What changes were proposed in this pull request? Varka now compiles `IN` and `InSet` through one condition arm for every type that has a lane, instead of four near-identical arm pairs. As a result, `IN` over `INT`, `BIGINT`, `TIME` and day-time intervals fuses; until now it declined. **One arm.** The four `In`/`InSet` arm pairs in `VarkaConditionCompiler` (date and year-month, long, floating, and the narrow lanes) are merged into one, `inArm` with `compileIn`. Their folds were one algorithm over sign-extended lane bits. The literal reader comes from the type registry (`VarkaTypes.Info.laneBits`, which returns empty rather than throwing), and each literal takes the table slot of the value's lane (`bitsSlot`). The merge was proven first, before any type was added: regenerating `emitted_bytes.json`, `coverage.json` and `width_audit.json` left all three byte-identical. **What the arm admits.** The value's type must be admitted on a lane of its own; the arm is an exhaustive switch over the registry's admissions. The value must compile onto exactly its type's lane, so a literal can never be slotted at a narrower lane than its type. An element is read if it is a literal or a foldable expression of the value's type; Spark's `IN` coercion wraps a narrower literal in a `Cast`. Evaluating an element at plan time declines on any non-fatal error, never failing the query. The elements are read one at a time, stopping at the 16-literal cap, so a large `InSet` costs no more than 17 reads. **Floating literals follow Spark's equality.** Spark's `In` compares doubles with `SQLOrderingUtil.compareDoubles`, and `InSet`'s set behaves the same, so `-0.0` equals `0.0` and every NaN equals every NaN. Literals are now deduplicated that way, so `0.0` and `-0.0`, or two NaN payloads, count once against the cap. Answers were already right, because the lane's equality is the same. **What checks it:** - 8 new coverage rows: `IN` over `i`, `l`, `t` and `dt` with three literals, and each one's eleven-literal `InSet` twin, verified differentially against Spark. - An order test, which passed on the old four arms before the merge and on the new arm after it, over both zeros and NaN payloads on the floating types. - Compiler tests that pin the declines: a value off its type's lane (an `INT` on the byte lane with `IN (300, 1)`), a floating value on an int lane, an element whose evaluation throws a checked exception, an empty list, and the cap reached before a null element. **Generated files**, regenerated in the documented order: `coverage.json` and `docs/sql-varka.md` gain the new rows; `width_audit.json` gains entries of the kinds the comparisons already have; `emitted_bytes.json` gains the new rows, and only the `option_arms` digests that hash every shape move; `census.tsv` moves 8 pairs. ### Why are the changes needed? `IN` is one of the most common filter shapes, and over integers, longs, times and day-time intervals it ran on Spark's row path even when everything around it fused. Four copies of the same arm also meant each new type had to be added four times. ### Does this PR introduce _any_ user-facing change? Yes, for users who enable Varka: `IN` and `InSet` over `INT`, `BIGINT`, `TIME` and day-time interval columns are now evaluated by Varka's kernels, with the same answers as Spark. ### How was this patch tested? - On the laptop: `VarkaExpressionCompilerSuite`, `VarkaCoverageSuite`, `VarkaEmittedBytesSuite`, `VarkaWidthAuditSuite`, `VarkaIrFuzzSuite`, `VarkaTypesSuite` and `VarkaFamilyChainSuite` (208 tests), and `VarkaCoverageHarnessSuite` with `VarkaCoverageDifferentialSuite` (1,427 tests), with no failures. - A self-review (`/code-review high`, then a medium round on the fixes) found and fixed: a lane guard that let a value on a narrower integral lane through, a plan-time evaluation that could fail planning, reading every element of a large `InSet` before the cap, a non-exhaustive admission check, and floating duplicates counted against the cap. - Errorprone, lint-java, lint-scala and the plan, quote and census checks are clean. The PR Build and the option matrix run on this head. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
apache#1260) ### What changes were proposed in this pull request? **Merge after apache#1259**, the single `IN` arm, which this branch merges in and builds on; until it lands, this diff includes its commits. Varka now fuses the choice and null shapes it declined on its existing types: `INT` branches of `IF`, `CASE`, `coalesce`, `greatest` and `least`, and a typed `NULL` branch, which `CASE` without `ELSE`, `IF(c, x, NULL)`, `nullif` and `nullifzero` need. **Int branches.** An `INT` choice's branches and operands now compile through the rule that int comparison operands already use: a plain int column, an int literal, or an int expression the compiler already has. This only applies when the whole choice is an `INT`, so no existing shape's emitted bytes move, `date_add(d, i)`'s among them. **A null leaf.** A new IR node, `NullValue`, stands for a typed `NULL` on the int and long lanes. Its vector holds zero, and its validity word is clear on every lane. A kernel holding one never takes the dense body, since some lane is always null. It is wired through: - the reference evaluator and the canonical form; - the fuzz grammar, which draws it as an `ELSE`, as a `THEN`, under `greatest` or `least`, and twice in one `CASE`, on a seed of its own so the committed draws do not move; - the inventory suites. Common-subexpression sharing never shares it, as with a literal. The leaf is admitted per type by an exhaustive switch over the type registry. Today it covers `DATE`, `INT`, `BIGINT`, `TIME` and both interval types. The others decline with "no null leaf for type t" until their own rows add it. **Rewritten conditionals.** By the time Varka sees them, `nullif(i, 3)` is `If(i = 3, null, i)` and `i BETWEEN 1 AND 9` is an `AND` of two comparisons, so both fuse through the shapes above. A computed operand makes either one two projections, so only the column form is claimed. `positive` and `known_not_null` never reach Varka: the optimizer removes them. **What checks it.** 50 new coverage rows, each verified against Spark by the coverage harness and the differential suite. They cover the int choices; the null branch on each of the six types; `greatest` and `least` with a `NULL` operand beside the type's minimum and maximum; and the rewritten conditionals. Compiler tests pin each decline reason. **Generated files**, regenerated in the documented order: `coverage.json`, `docs/sql-varka.md` and `width_audit.json` gain the new rows; `emitted_bytes.json` gains the new rows' entries, and only the `option_arms` digests that hash every shape move; `census.tsv` moves 37 pairs. ### Why are the changes needed? A `CASE` without `ELSE`, a `nullif`, or an `INT` `coalesce` sent the whole expression around it back to Spark's row path, though everything else in it fused. These shapes are common in real queries, both written by hand and generated by tools. ### Does this PR introduce _any_ user-facing change? Yes, for users who enable Varka: these choice and null shapes over `DATE`, `INT`, `BIGINT`, `TIME` and interval columns are now evaluated by Varka's kernels, with the same answers as Spark. ### How was this patch tested? - On the laptop: the compiler, coverage, emitted-bytes, width-audit, IR fuzz, proof-file, budget, cost-model, reproduction and composition-fuzz suites, and the twelve conformance suites (354 tests); and the coverage harness, differential and kernel evaluator suites (1,568 tests); with no failures. - A self-review (`/code-review high`, then a medium round on the fixes) found and fixed: an untested `greatest`/`least` over a `NULL` operand, a fuzz draw that placed the null leaf in one position only, a hand-written type list, and stale decline reasons. - Errorprone, lint-java, lint-scala and the plan, quote and census checks are clean. The PR Build and the option matrix run on this head. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
…l requests (apache#1370) ### What changes were proposed in this pull request? Seventeen rows of `sql/varka/plans/m8/PLAN.md` still read as before work that has merged. Each is corrected against its merged pull requests, which `git log` lists by the row's `[VARKA-n]` tag: - **Now `Done`:** row 497 (one `IN` arm for every lane, apache#1259), row 333 (apache#1260) and row 365 (the Arrow cache's small decimals read as vanilla Spark reads them, apache#1306). The done-when of each is met by that pull request, and the "left" text that waited on it is gone. - **Still `Started` or `Done in part`, with merged parts named:** rows 157, 330, 331, 332, 333, 340, 341, 342, 343, 344, 348, 349, 377, 503 and 538. Branch names that stood for work now merged become the pull request numbers and dates (for example 348's four parts, apache#1321, apache#1323, apache#1324 and apache#1349), and a "left" item that merged is dropped (538's flip, apache#1345; 341's mask crossing, closed by 343a3 and 343a3b; 377's decimal class, apache#1055). - Row 377 now says what is still open: the floating baseline does not state whether its data holds denormals, which its done-when of 27 October 2026 asks. - Rows 332 and 333 are read against their done-when. Row 333 is `Done` (apache#1260: its outcome records the census, the coverage rows and the unmoved `date_add` bytes). Row 332 stays `Started`: its 14 non-identity casts fuse (apache#1291), and what is left is 332b's in-range conformance value sets, the measurement against the baseline (no results file exists), two gaps from the 2 November review, and row 352's fuzz productions. Only row text changes; no code, result or generated file. ### Why are the changes needed? A reader who takes a row's state at its word re-plans or restarts work that merged, which the triage of 4 November 2026 found for these rows. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? `dev/varka_plan_lint.py` and `dev/varka_quote_check.py` pass. Every pull request number and date in the new text was read from `git log` of master. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Sonnet 5.5)
We use TID to indicate task logging. However, TID itself does not capture stage or retries, making it harder to correlate with the application itself. This pull request changes all logging messages for tasks to include both the TID and the stage id, stage attempt, task id, and task attempt. I've consulted various people but unfortunately this is a really hard task.
Driver log looks like:
Executor log looks like