Skip to content

[SPARK-2523] [SQL] Hadoop table scan bug fixing (fix failing Jenkins maven test) - #1669

Closed
yhuai wants to merge 1 commit into
apache:masterfrom
yhuai:SPARK-2523-fixTest
Closed

yhuai wants to merge 1 commit into
apache:masterfrom
yhuai:SPARK-2523-fixTest

Conversation

@yhuai

@yhuai yhuai commented Jul 30, 2014

Copy link
Copy Markdown
Contributor

This PR tries to resolve the broken Jenkins maven test issue introduced by #1439. Now, we create a single query test to run both the setup work and the test query.

@marmbrus

Copy link
Copy Markdown
Contributor

Oh, clever. This isn't actually what I was suggesting but is a better solution :) I forgot that createQueryTest could handle multiple sql statements.

@yhuai

yhuai commented Jul 30, 2014

Copy link
Copy Markdown
Contributor Author

test this please

1 similar comment
@marmbrus

Copy link
Copy Markdown
Contributor

test this please

@chenghao-intel

Copy link
Copy Markdown
Contributor

Thank you @yhuai, that seems cool. But can you also remove the old golden answer file? It should be unused now.
golden/partition_based_table_scan_with_different_serde-0-8caed2a6e80250a6d38a59388679c298

@chenghao-intel

Copy link
Copy Markdown
Contributor

Oh, sorry, I saw that, it renamed.

@yhuai

yhuai commented Jul 31, 2014

Copy link
Copy Markdown
Contributor Author

Jenkins, test this please.

@SparkQA

SparkQA commented Jul 31, 2014

Copy link
Copy Markdown

QA tests have started for PR 1669. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17556/consoleFull

@SparkQA

SparkQA commented Jul 31, 2014

Copy link
Copy Markdown

QA results for PR 1669:
- This patch FAILED unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17556/consoleFull

@marmbrus

Copy link
Copy Markdown
Contributor

test this please

@SparkQA

SparkQA commented Jul 31, 2014

Copy link
Copy Markdown

QA tests have started for PR 1669. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17590/consoleFull

@SparkQA

SparkQA commented Jul 31, 2014

Copy link
Copy Markdown

QA results for PR 1669:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17590/consoleFull

@marmbrus

Copy link
Copy Markdown
Contributor

Thanks for fixing this. Merged into master!

@asfgit asfgit closed this in 49b3612 Jul 31, 2014
@yhuai
yhuai deleted the SPARK-2523-fixTest branch July 31, 2014 21:09
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
…maven test)

This PR tries to resolve the broken Jenkins maven test issue introduced by apache#1439. Now, we create a single query test to run both the setup work and the test query.

Author: Yin Huai <huai@cse.ohio-state.edu>

Closes apache#1669 from yhuai/SPARK-2523-fixTest and squashes the following commits:

358af1a [Yin Huai] Make partition_based_table_scan_with_different_serde run atomically.
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Nov 23, 2026
…ut fusion (apache#1669)

### What changes were proposed in this pull request?

This regenerates `sql/varka/plans/m8/casts_suites.tsv`, the record of Spark's cast suites under Varka, on current master. It also updates the record's counts in `VARKA-368.md` (now 193 fused, 681 declined).

### Why are the changes needed?

Master's post-merge run 45171015126 failed on `8e631d8ed41`. `VarkaCastWithAnsiOffSuite`, `VarkaCastWithAnsiOnSuite` and `VarkaTryCastSuite` aborted in `afterAll`, because their lines in the record moved.

apache#1646 added the record. It was generated and tested on a base without apache#1628, and apache#1628 merged before apache#1646. apache#1628 fuses every 64-bit decimal value as a projection output. So 120 lines changed:

- A cast to a decimal now declines with "is row 350's" instead of "is row 348's".
- Five identity casts of 64-bit decimals now fuse (for example `DECIMAL(10,0)` to `DECIMAL(10,0)`), in all three suites and modes.

apache#1652 (also in that run) changes only matrix tooling and plans.

### Does this PR introduce _any_ user-facing change?

No. This changes only a generated test record.

### How was this patch tested?

- Regenerated with `VARKA_SUITES_REGEN=true build/sbt 'sql/testOnly *VarkaCastWithAnsiOffSuite *VarkaCastWithAnsiOnSuite *VarkaTryCastSuite'`. The 240 changed lines are exactly the lines CI printed.
- The three suites then pass without the regen flag: 435 tests, 0 aborted.
- `dev/varka_census.py --check` passes. The census changes no other file.

`/code-review high` found no bugs and three nits. One round fixed two: the commit message now counts all five newly fused casts, and the plan's counts are updated. The third nit was the commit's placeholder author. It is kept, because the PR is squash-merged.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Nov 24, 2026
…wo lanes (apache#1663)

<!-- title: [VARKA-612] Decline the day-time interval checks measured slower at two lanes -->
### What changes were proposed in this pull request?

At 128 bits an x86 host has two 64-bit lanes, and C2 lowers no 64-bit mask there, so a long-lane check's compare runs as the Vector API's Java loop. The day-time interval baseline read 0.5x to 1.0x at 128 bits, against 3.9x to 4.4x at 256. Master already declines a checked `BIGINT` operation there.

- On that host the compiler now also declines the checked day-time interval arithmetic measured slower: `dt + dt2`, `dt - dt2`, `abs(dt)` and `dt * k`, with `TWO_LANE_CHECK_REASON` in EXPLAIN (`VarkaIntervalCompiler.twoLaneMeasured`).
- Only the form's own check counts. A form whose check the range lattice removed, or whose only check sits in an operand, keeps fusing.
- The day-time baseline lists its three checked sections as `NONE` under the refusal, and its suite checks both settings.
- `VarkaTwoLaneDefault128Suite` enables `TIME` and checks the day-time arms decline while `TIME` and `TIMESTAMP_NTZ` checks fuse beside them.
- A two-lane census of the coverage table's value rows, `results/VARKA-612-refused.txt` (13 of 476), which `VarkaCoverageSuite` holds to what it renders.

<details>
<summary>What still fuses unmeasured, and design details</summary>

These long-lane checks keep fusing at two lanes, never measured there: `-dt`, `TIME`'s and `TIMESTAMP_NTZ`'s (`t + dts`, `ntz + dt`, `ntz - ntz2`, `timestampadd`), the ANSI and try narrowing casts of a `BIGINT` (`CAST(l AS INT)`), `d - d2`, `CAST(d AS TIMESTAMP_NTZ)` and `CAST(dt AS BIGINT)`. Their 128-bit measurement is owed as a follow-up (`VARKA-612.md` 9.4): no section times ANSI `CAST(l AS INT)`, `try_cast(l AS INT)`, `timestampadd(MONTH, <bigint>, ntz)`, `CAST(d AS TIMESTAMP_NTZ)` or `d - d2` yet, so new sections come first, then two runs at `-XX:MaxVectorSize=16` on an EPYC 7763, compared by minimums. A family slower there joins `twoLaneMeasured` in its own change.

The kernel plan refuses no check; `VarkaKernelPlan.holdsLongLaneCheck` is the walk the tests ask.

`VARKA-612-refused.txt` is rewritten by every coverage regeneration. `dev/varka_generated_merge.py` does not know the file, so a later branch that adds coverage rows (337a3, 609) must regenerate it, as `pre-pr.sh`'s full regeneration does.

</details>

### Why are the changes needed?

The checked day-time arms ran slower than the row path at 128 bits, so fusing them there costs time. The refusal sends them to the row path, as master does for a checked `BIGINT` operation.

### Does this PR introduce _any_ user-facing change?

No new setting. On x86 at 128 bits, the checked day-time interval arithmetic runs on the row path, with the reason in EXPLAIN. Answers are unchanged.

### How was this patch tested?

On the laptop, after the narrowing and its review fixes: `catalyst/testOnly *VarkaTwoLaneConditionSuite *VarkaCoverageSuite` passed (26, 1 cancelled), with the census file regenerated unchanged, and `*VarkaExpressionCompilerSuite -- -z "two-lane"` passed (3). Before the last fix: `sql/testOnly *VarkaTwoLaneDefault128Suite` (5) and the day-time, integral-cast and three `TIMESTAMP_NTZ` baseline queries suites passed (12).

The full local gate (`~/varka-ops/pre-pr.sh`) passed on `abf59d39901`. It merged master at `8e631d8ed41`, and its regeneration commit moved `width_audit.json`, `docs/sql-varka.md`, `casts_suites.tsv` and one line of `VARKA-612-refused.txt`. Extra-gate (lints, Error Prone, invariant and proof suites) passed, and so did the push check, at 450 counted lines. It passed again on `200cda31dfb`, the merge of master at `c4b0475d86e`, which brings apache#1669's regenerated `casts_suites.tsv` and apache#1626: that merge hand-resolved `DeclineSink`, `VarkaNodeCompiler` (master's `guardsProduct` kept, its copy of `TWO_LANE_CHECK_REASON` dropped for this branch's `VarkaKernelPlan` one) and `VarkaEmitterLongLaneSuite`'s new two-lane assertion, and a `/code-review high` of the resolution found no bug in it; the regeneration moved nothing, and the arm sweep over the changed catalyst and sql suites passed at the defaults, `useAVX=2` and `useAVX=3`.

The arm sweep ran every configuration (59 and the defaults) without a failure. `VarkaCoverageSuite` and `VarkaExpressionCompilerSuite`: 11,174 passed, 340 cancelled. `VarkaDayTimeIntervalBaselineQueriesSuite` and `VarkaTwoLaneDefault128Suite`: 361 passed, 59 cancelled.

CI is held at the owner's request. This PR is opened so its owed benchmarks can run on the runners. The CI Build and the option matrix run later.

<details>
<summary>What is owed</summary>

The 128-bit measurement of the unmeasured families, and a 128-bit rerun of `VarkaDayTimeIntervalBaselineBenchmark`, whose committed file still says the three checked sections fuse (`VARKA-612.md` 9.4, the owner's dispatch). A CI Build and the option matrix.

</details>

### Review

The first `/code-review high` found that the 128-bit suite's test would be left to Spark by row 613's rule, and that the census file was not committed; both are fixed. On the owner's decision the refusal was then narrowed from a tree walk over every long-lane check to the measured family. The re-review of that found two important issues: the stale width audit, which the regeneration answers, and an operand's check declining a measured form, now fixed. The review covers `120f563f38e`. After it come only the gate's master merge and its regeneration commit.

<details>
<summary>The nits left</summary>

- `VARKA-612-refused.txt` is unknown to the generated-file merge driver (above).
- `notACheck` tests only int-driven plans.

</details>

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Nov 24, 2026
…ow path (apache#1664)

<!-- title: [VARKA-601] Add a baseline that times split filters against Spark's row path -->
### What changes were proposed in this pull request?

When Varka fuses only part of a `WHERE` condition, it splits the filter. A Varka kernel evaluates the conjuncts it can and copies each kept row into an `UnsafeRow`; Spark's `FilterExec` above it evaluates the rest. No baseline could time such a split, because the baselines' class check had no class for its plan.

- `Fusion.SPLIT` in `VarkaSqlBenchmarkBase`: one `FilterExec` directly above one Varka to-row filter whose own conjuncts read a value.
- `VarkaSplitFilterBaselineBenchmark`: splits whose fused part keeps 90% or 10% of the rows, over `INT` and `BIGINT`, a wider row copy, and two controls, each with and without nulls.
- Every `SPLIT` and `WHOLE` section is run once first, to check that the kernel serves every batch.
- `VarkaSplitFilterBaselineQueriesSuite` checks the shares, the answers and each section's class.

<details>
<summary>Design details</summary>

`fusion` returns `SPLIT` only where it returned empty before, so no existing section changes class.

Every residual is `hash(i) % 7 <> 0`, which no kernel computes.

The `BIGINT` splits are `NONE` where the session refuses 64-bit filter conditions.

The kernel check is skipped with the fuse check lifted, the run that measures a row changing a section's class.

Row 549, also unmerged, moves one `requireKernel` into `VarkaSqlBenchmarkBase`. Whichever of the two merges second folds this class's copy into it.

</details>

### Why are the changes needed?

A split can lose to Spark's own filter, since the copy of every kept row costs time. A split whose fused part is only `IS NOT NULL` tests lost by 59 and 83 ms on 2M rows, and Varka now declines it. A fused part that reads a value drops rows before the copy, but no run has measured it. This makes the measurement possible.

### Does this PR introduce _any_ user-facing change?

No. Benchmark and test code only.

### How was this patch tested?

The full local gate passed on bbc419a, and again on a89d111, the merge of master at 78d68d3 that brings apache#1669's regenerated `casts_suites.tsv` (the previous Build aborted the three cast suites in sql shards 1 and 2 on that file's moved lines).

The full local gate (`~/varka-ops/pre-pr.sh`: merge of master, regeneration, lints, Error Prone, the push check and the arm sweep over every configuration) passed: the sweep ran 59 configurations and the defaults over the two changed suites, 191 tests passed, 0 failed (649 cancelled by the suites' own assumptions).

CI is held at the owner's request; it starts when the fork has capacity.

<details>
<summary>Full test record</summary>

Not run: the dry run, the runner dispatches at both widths, a CI Build and the option matrix.

</details>

### Review

`/code-review high` on the rebased branch found two important issues, both fixed: row 601's status would have renamed its mirrored issue to a date, and the kernel check ran with the fuse check lifted. Two of four nits are fixed.

<details>
<summary>The nits left</summary>

- `requireKernel` is a copy of the day-time baseline's (see row 549 above).
- One test comment says "the same residual" where the residuals differ.

</details>

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants