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

[BEAM-115] WIP: JSON Schema definition of pipeline #662

Closed
wants to merge 1 commit into from

Conversation

kennknowles
Copy link
Member

This is a json-schema sketch of the concrete schema from the Pipeline Runner API proposal document. Because our serialization tech discussion seemed to favor JSON on the front end and Proto on the backend, I made this quick port. The original Avro IDL definition is also on a branch with a test.

Notes & Caveats:

  • I did not try to flesh out any more details; this was a straight port. There's plenty to add, but a PR seems like a place that will attract a desired kind of concrete discussion even in the current state.
  • Typing this makes my hands hurt. Luckily, it should change exceedingly rarely. There are many libraries that can generate json-schema in various ways, including Jackson itself, but I'm not so sure any of them are applicable.
  • Reading this makes my eyes hurt. This is a real problem. We need a readable spec, not just a test suite for validation.
  • I am not so sure that the schema library I've used to build my smoke test is a good long term choice. I chose it because it was Jackson-based.
  • I've left comments in the JSON even though that is frowned upon, and taken advantage of Jackson's feature to allow them. They can also go into "description" fields.
  • Perhaps we could write YAML and convert to json-schema with no loss of precision?

Feel free to leave comments here about the schema or meta issues of e.g. where the schema should live and what libraries we might want to use.

"additionalProperties": { "$ref": "#/definitions/Value" }
},

// A flat list of windowing strategies. These may be referenced repeatedly.
Copy link
Member

Choose a reason for hiding this comment

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

Don't you mean a mapping as well?

@kennknowles
Copy link
Member Author

@aaltay ping for Python feedback. Its quite a rough WIP.

// A mapping containing all user-definable functions in the pipeline.
// The keys must be unique to this pipeline definition, but otherwise are
// arbitrary.
"userFns": {
Copy link
Member

Choose a reason for hiding this comment

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

Are these object ids used anywhere aside from cross referencing things in the pipeline description?

If that is the case, we could use an array and use array index to reference them, It will be a more compact pipeline, and remove some arbitrary ids. This will be less error prone at pipeline generation time (in regards to uniqueness requirement.)

Copy link
Member Author

Choose a reason for hiding this comment

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

They are just for cross-referencing. I wanted to leave the mechanism of coming up with the IDs unspecified.

@kennknowles
Copy link
Member Author

Closing for a bit.

@kennknowles kennknowles reopened this Dec 21, 2016
@asfbot
Copy link

asfbot commented Dec 21, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6174/
--none--

<dependencies>
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
Copy link
Member Author

Choose a reason for hiding this comment

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

Consider Python libraries for use in smoke testing.

@kennknowles
Copy link
Member Author

This is superseded by #1946 which ports the schema to proto and updates it.

@kennknowles kennknowles deleted the pipeline-json-schema branch March 31, 2017 23:55
pl04351820 pushed a commit to pl04351820/beam that referenced this pull request Dec 20, 2023
…apache#662)

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
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.

None yet

4 participants