Skip to content

[BEAM-9379] Update calcite to 1.26 - #14729

Merged
apilloud merged 23 commits into
apache:masterfrom
apilloud:updatecalcite
Sep 2, 2021
Merged

[BEAM-9379] Update calcite to 1.26#14729
apilloud merged 23 commits into
apache:masterfrom
apilloud:updatecalcite

Conversation

@apilloud

@apilloudapilloud commented May 5, 2021

Copy link
Copy Markdown
Member

This replaces #12962.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

LangULRDataflowFlinkSamzaSparkTwister2
Go---Build StatusBuild Status---Build Status---
JavaBuild StatusBuild Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build StatusBuild Status
Build Status
Build Status
Build Status
Python---Build Status
Build Status
Build Status
Build Status
Build Status
---Build Status---
XLangBuild StatusBuild StatusBuild Status---Build Status---

Examples testing status on various runners

LangULRDataflowFlinkSamzaSparkTwister2
Go---------------------
Java---Build Status
Build Status
Build Status
---------------
Python---------------------
XLang---------------------

Post-Commit SDK/Transform Integration Tests Status (on master branch)

GoJavaPython
Build StatusBuild StatusBuild Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

---JavaPythonGoWebsiteWhitespaceTypescript
Non-portableBuild Status
Build Status
Build Status
Build Status
Build Status
Build StatusBuild StatusBuild StatusBuild Status
Portable---Build StatusBuild Status---------

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@codecov

codecovBot commented May 5, 2021

Copy link
Copy Markdown

Codecov Report

Merging #14729 (965154a) into master (3a7b8e7) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #14729 +/- ##
=======================================
Coverage 83.74% 83.75% =======================================
Files 442 442 Lines 60050 60050 =======================================
+ Hits 50290 50295 +5 + Misses 9760 9755 -5 
Impacted FilesCoverage Δ
sdks/python/apache_beam/internal/metrics/metric.py90.42% <0.00%> (-1.07%)⬇️
...hon/apache_beam/runners/worker/bundle_processor.py93.64% <0.00%> (+0.12%)⬆️
sdks/python/apache_beam/io/localfilesystem.py92.24% <0.00%> (+0.77%)⬆️
...che_beam/runners/interactive/interactive_runner.py92.52% <0.00%> (+1.86%)⬆️
.../python/apache_beam/testing/test_stream_service.py93.02% <0.00%> (+4.65%)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a7b8e7...965154a. Read the comment docs.

@apilloud
apilloudforce-pushed the updatecalcite branch 2 times, most recently from 522c3f6 to ea51944CompareMay 5, 2021 05:02
@apilloud

Copy link
Copy Markdown
MemberAuthor

run sql postcommit

@apilloud
apilloudforce-pushed the updatecalcite branch 3 times, most recently from 94d3bf0 to ab7c78dCompareMay 26, 2021 21:18
@ibzib

Copy link
Copy Markdown

Cannot cast "byte[]" to "ByteString"

Seems to be because of this commit: apache/calcite@dae53ef#diff-2095e662d66d6c1b2851915fa0d73934c3a847550545396835e02d88a9f5e2daR2858-R2871

Calcite 1.24+ casts UDF return values to their expected Java types. Calcite's default JavaTypeFactoryImpl maps VARBINARY to ByteString. We can fix it by overriding this mapping to return byte[] instead.

By the way, org.apache.beam.sdk.extensions.sql.zetasql.ZetaSqlJavaUdfTest.testNullArgumentIsNotTypeChecked tests for bad behavior, so having it fail is actually a good thing. I'm guessing the casts added in that same commit fixed the bug (late type checking) it was testing for. So we can just update the test to reflect that.

I committed fixes for these issues to my branch: https://github.com/ibzib/beam/commits/updatecalcite-udf-types

@apilloud
apilloudforce-pushed the updatecalcite branch 2 times, most recently from 3b5a1f5 to c93f18cCompareJuly 1, 2021 20:54
@apilloud
apilloudforce-pushed the updatecalcite branch 8 times, most recently from f3e85e4 to 41d714cCompareAugust 13, 2021 01:39
@apilloud
apilloudforce-pushed the updatecalcite branch 3 times, most recently from f29da0a to a42956eCompareAugust 20, 2021 18:16
@apilloudapilloud changed the title [WIP][BEAM-9379] Update calcite to 1.26[BEAM-9379] Update calcite to 1.26Aug 20, 2021
@apilloud

Copy link
Copy Markdown
MemberAuthor

run java precommit

@apilloud

Copy link
Copy Markdown
MemberAuthor

This is finally ready for review! @ibzib@nielsbasjes

@apilloud
apilloud requested a review from ibzibAugust 20, 2021 19:37
@apilloud

Copy link
Copy Markdown
MemberAuthor

Sorry for the massive size. You might have better luck reviewing if you drop the first (generated) commit: 303c959...54881ce

You'll still have to comment on the PR directly.

@apilloud

Copy link
Copy Markdown
MemberAuthor

Run Java_Examples_Dataflow PreCommit

@apilloud

Copy link
Copy Markdown
MemberAuthor

Run Java PreCommit

@apilloud
apilloud merged commit cff331b into apache:masterSep 2, 2021
@apilloud
apilloud deleted the updatecalcite branch September 2, 2021 22:29
@ibzib

ibzib commented Sep 2, 2021

Copy link
Copy Markdown

🥳

@aromanenko-dev

Copy link
Copy Markdown
Contributor

Please, don't forget to squash the commits before merge or just use GitHub's "Squash and Merge" button.

@apilloud

Copy link
Copy Markdown
MemberAuthor

These commits include valuable information. I am -1 on squashing commits.

@aromanenko-dev

aromanenko-dev commented Sep 6, 2021

Copy link
Copy Markdown
Contributor

Do you mean all these 23 commits merged with this PR? Then, every commit requires Jira Id prefix to make it easier to track commits history.

Tbh, I doubt that commits like "Update CHANGES.md" and "Up spotbug stack size" can't be squashed with main PR's commit(s). It should make reading commits history easier.

@apilloud

Copy link
Copy Markdown
MemberAuthor

I'm not sure what tools you are using to view history, but many of them have ways to give your preferred view. For example git log --first-parent, git blame --first-parent etc.

I squashed fixup commits and put effort into keeping the commits clean, if I hadn't it would easily be 100 commits. I could have been more aggressive on squashing in a few cases (I thought about squashing "Make it functional
" into "Update to vendored Calcite to 1.26.0"), but I would also argue that at least "Update to vendored Calcite to 1.26.0" is over squashed here. A single commit would not have been appropriate in this case.

For the two specific examples you've given: The "Update CHANGES.md" doesn't represent any single commit in the PR so I left it separate. The "Up spotbug stack size" is an issue exposed by this change that is mostly unrelated, it could have been a separate PR (like #15362). Perhaps I should have broken more of this out into separate PRs. This PR has been in the works for over a year, and resulted in many split off changes: #13930#14146#14518 possibly others I'm not remembering. (Also some of the commits in this change are being reverted in #15457.)

I don't think we are going to agree on the proper curation of git history, I don't like small "fixup" changes but I also think there are many cases where a PR can benefit from more than a single commit. I proposed banning the "Squash and Merge" button in 2018: https://lists.apache.org/thread.html/8d29e474e681ab9123280164d95075bb8b0b91486b66d3fa25ed20c2%40%3Cdev.beam.apache.org%3E

@aromanenko-dev

Copy link
Copy Markdown
Contributor

I see your reasons but I still don't see why it can't be squashed into several atomic and independent commits that reflect every major change of this PR and can be rolled back independently if required? What kind of additional value the tiny commits can bring?

Personally, taking into account that it was a long work on this feature and it required more changes than expected initially, I think it had to be split into several PRs or maybe even Jiras. In ideal world, every feature should have one Jira issue, one PR and one independent commit. If it requires more then it had to be split into more granular parts. Of course, there always can be some exceptions, but the goal is to keep a clear commit history and independent rollback.

In our "Commiter guide" we have the requirements for granularity of changes that we discussed before and we have to follow. So my initial point was mostly about that that should help us to make a git history clear. Now I don't see that it's always a case but we can easily make it better.

PS: Regarding the tools. I usually use tig for CLI and Intellij IDEA internal Git client to view annotated lines (git blame) or file history. Using lines annotations with many tiny commits signed by short commit messages and without Jira prefix makes it quite hard to do.

Sign up for freeto 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

@apilloud@ibzib@nielsbasjes@aromanenko-dev