Skip to content

[SPARK-1478].3: Upgrade FlumeInputDStream's FlumeReceiver to support FLUME-1915 - #1347

Closed
tdas wants to merge 3 commits into
apache:masterfrom
tdas:FLUME-1915
Closed

tdas wants to merge 3 commits into
apache:masterfrom
tdas:FLUME-1915

Conversation

@tdas

@tdas tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor

This is a modified version of this PR #1168 done by @tmalaska
Adds MIMA binary check exclusions.

tmalaska and others added 3 commits June 21, 2014 16:03
@tdas

tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor Author

Jenkins, test this please.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16475/

@tdas

tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor Author

This looks like an unrelated error. Running the test again.

@tdas

tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor Author

Jenkins, test this please.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@tmalaska

tmalaska commented Jul 9, 2014

Copy link
Copy Markdown

Man I'm sorry this is taking so long. Thank you for your help.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@tdas

tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor Author

Naah, somethings are flaky in jenkins, cant be helped much. Hopefully this will be done in another hour.

@tdas

tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor Author

Can you close the other PR?

@tmalaska

tmalaska commented Jul 9, 2014

Copy link
Copy Markdown

Yes let me figure that out now.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16479/

@tdas

tdas commented Jul 9, 2014

Copy link
Copy Markdown
Contributor Author

Jenkins, test this please.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16484/

@asfgit asfgit closed this in 40a8fef Jul 10, 2014
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
…FLUME-1915

This is a modified version of this PR apache#1168 done by @tmalaska
Adds MIMA binary check exclusions.

Author: tmalaska <ted.malaska@cloudera.com>
Author: Tathagata Das <tathagata.das1565@gmail.com>

Closes apache#1347 from tdas/FLUME-1915 and squashes the following commits:

96065df [Tathagata Das] Added Mima exclusion for FlumeReceiver.
41d5338 [tmalaska] Address line 57 that was too long
12617e5 [tmalaska] SPARK-1478: Upgrade FlumeInputDStream's Flume...
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Nov 4, 2026
…rows (apache#1347)

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

Varka already fuses decimal `+`, `-` and `*`, and their `try_` forms, when the result stays within 18 digits (apache#1339). This change proves that arithmetic exact with SMT, adds coverage rows that are each refined against Spark's semantics, and pins the decline reasons in both operand orders.

**The proofs of the arithmetic (`decimal64.smt2`).** A decimal of precision up to 18 is an unscaled long. The new checks, rendered by `VarkaProofFiles.decimal64Arithmetic`, are:
- **Sum and difference.** For each result precision `P` from 2 to 18, adding or subtracting two operands of at most `P - 1` digits is exact and stays within `P` digits. A `sat` witness shows that operands of `P` digits can leave the type, so the bound is tight.
- **Product, in two layers.** The ring layer: for each operand precision pair with `p1 + p2 <= 17`, the product is at most `10^(p1 + p2) - 1`. It multiplies two unknowns, but each has a constant bound. The wrap layer is linear: for each `n` from 2 to 17, an integer within `10^n - 1` is its own 64-bit wrap. A `sat` witness shows that two ten-digit operands can wrap.
- **Neighbours.** Three more checks: `a - b` leaving the type at `P = 18`; a bound one less than the largest product at `p1 = 8, p2 = 9` being refuted; and the wrap identity holding up to `Long.MAX_VALUE` and failing one past it.

The file grows from 346 to 554 checks. The sweep in `VarkaDecimalArithmeticSuite` checks, on every fused operand pair, that the IR reduces to the form these lemmas state. `spec/STANDARD.md` gains the result scales and exact values of `+`, `-` and `*` from SQL-92 6.12 SR 2. `proofs/README.md` records that this product's 136 bound checks are the first proofs in the repository to multiply two unknowns. Each unknown has a constant bound and nothing in the check wraps, so both solvers decide them.

**The coverage rows and their refinement (`refinement.smt2`).** A new "DECIMAL arithmetic" coverage family has ten predicates. They use the existing decimal columns and a new `d8` (`DECIMAL(8, 2)`): `d9 + d9b < d18`, `d9 - d8 >= d9b`, `d8 * d9 <= d9b`, `try_add(d9, d9b) > d18`, `d9 * 0.5 > d9b`, `d9 + 1.5 < d9b`, `d9 - d9s4 > 0.00`, `d9 + d16s9 > d9s4`, `-(d9 + d9b) = d9s4` and `try_multiply(d8, d9) IS NULL`. Each row, its comparison included, is refined as a whole in every mode:
- under ANSI, where a result past its precision raises;
- under LEGACY and TRY, where it is null;
- the `try_add` row under TRY alone.

A product's exact value is a free integer bounded by the ring layer. The section takes the file from 276 to 366 checks. `VarkaEmittedBytesSuite` compiles each row in six spellings: ANSI off and on and precision loss on and off, each also with every decimal operator in TRY mode. It asserts one set of method hashes at both widths, which shows that one kernel serves every mode. The IR fuzzer's decimal sequence now draws sums, differences and products within 18 digits, and its reach test asserts that all three are drawn.

**The decline reasons, in both operand orders.** A result past 18 digits declines and names the row that will build it. The suite now pins those texts with the wide operand on each side, and pins a product past 38 digits. It also pins the case where a rescale into the wide type wins over the arithmetic rows. For example, `IF(p, a * b, x)` with `a` and `b` at `(9, 2)` and `x` at `(18, 2)` rescales `x` into `(20, 4)`. It therefore names rows 359 and 360, not 361. The comparison literals take the node's scale, so the expected text cannot drift with literal typing.

**Generated files** were regenerated with `dev/varka_regen_generated.sh --all` on this tree.

### Why are the changes needed?

The kernels that apache#1339 added answer decimal arithmetic without Spark's overflow check, and one kernel serves LEGACY, ANSI and TRY. That is correct only if a result within 18 digits can never overflow or wrap the long lane. Without the proofs, that claim rested on tests over sampled values. Without the refinement and bytes tests, nothing showed that each fused shape matches Spark's semantics in every mode. Without the pins, a decline could start naming the wrong row and no test would notice.

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

No. It adds proofs, tests and coverage rows. The kernels and their answers are unchanged.

### How was this patch tested?

- `dev/varka_prove.sh --solver both`: Z3 and cvc5 both hold every check. On the laptop, `decimal64.smt2`'s 554 checks took 0.13 s under Z3 and 1.55 s under cvc5, and `refinement.smt2`'s 366 took 4.61 s under cvc5.
- `VarkaDecimalArithmeticSuite`, `VarkaDecimalValueSuite`, `VarkaProofFilesSuite`, `VarkaCoverageSuite`, `VarkaEmittedBytesSuite`, `VarkaWidthAuditSuite` and `VarkaIrFuzzSuite` under `dev/varka_matrix.sh --defaults`: 76 tests passed, none failed. The 5 canceled tests are opt-in dumps and audits. In sql core, `VarkaCoverageDifferentialSuite` and `VarkaDecimalBaselineQueriesSuite`: 59 tests passed.
- `dev/varka_push_check.py --no-jvm`, Error Prone, scalastyle and lint-java pass.
- The change counts 761 hand-written lines.

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

Generated-by: Claude Code (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.

3 participants