Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update starcgen for new types #7738

Merged
merged 1 commit into from
Feb 5, 2019
Merged

Update starcgen for new types #7738

merged 1 commit into from
Feb 5, 2019

Conversation

lostluck
Copy link
Contributor

@lostluck lostluck commented Feb 5, 2019

Updates the starcgen code generator to better handle Pointer, Map, and Array types.

  • Slice suffix for function names is now a prefix to avoid collisions in ordering with Maps of Slice of Arrays or similar
  • Filter out "universal" named types such as error.
  • Filter out Beam internal types (beam.X/typex.X and similar)
  • Improve test coverage for both the templates and the analyzer.
  • Regenerate the beam shims with go generate ./...

Follow this checklist to help us incorporate your contribution quickly and easily:

  • 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.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@lostluck
Copy link
Contributor Author

lostluck commented Feb 5, 2019

R: @aaltay Please review.
The material changes are in the files under sdks/go/pkg/beam/util/. The rest are just the consequent generated code changes.

@lostluck
Copy link
Contributor Author

lostluck commented Feb 5, 2019

Run Go PreCommit

}
if strings.HasPrefix(t, "map[") {
if i := strings.Index(t, "]"); i >= 0 {
// It should read MapOfTypeName.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MapOfTypeName -> MapOfKeyTypeName_ValueTypeName ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Nice catch!

@lostluck
Copy link
Contributor Author

lostluck commented Feb 5, 2019

The Jenkin's environment appears to be interestingly configured due to GoGradle, so the tests for the shim-generator are unable to handle imports reliably there. They work fine locally.

I've opted to add special casing to check if that code can succeed first, and skip the test if not. It's sufficient that they run every time I do go test ./... locally.

@aaltay aaltay merged commit 212a2ab into apache:master Feb 5, 2019
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.

2 participants