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

feat: Add static getter for TableDefinition in KafkaTools #5956

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

robbcamera
Copy link
Contributor

No description provided.

Copy link
Contributor

github-actions bot commented Aug 19, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@robbcamera
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@robbcamera robbcamera changed the title Add static getter for TableDefinition in KafkaTools feat: Add static getter for TableDefinition in KafkaTools Aug 19, 2024
@robbcamera
Copy link
Contributor Author

recheck

deephaven-internal added a commit to deephaven/cla that referenced this pull request Aug 19, 2024
* @return A TableDefinition derived from the input Properties and KeyOrValueSpec instances
*/
@SuppressWarnings("unused")
public static TableDefinition getTableDefinition(
Copy link
Member

Choose a reason for hiding this comment

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

We should explicitly call out the potential statefulness of KeyOrValueSpec. If the caller is going to rely on the correctness of this method, they must call consume with the exact same instances of keySpec / valueSpec.

ie, the following is incorrect:

TableDefinition tableDefinition = getTableDefinition(properties, null, avroSchema("MyValueSchema"));
Table table = consume(properties, ..., avroSchema("MyValueSchema"), ...)

it must be

KeyOrValueSpec myValueSpec = avroSchema("MyValueSchema");
TableDefinition tableDefinition = getTableDefinition(properties, null, myValueSpec);
Table table = consume(properties, ..., myValueSpec, ...)

Copy link
Member

@devinrsmith devinrsmith Aug 20, 2024

Choose a reason for hiding this comment

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

Or rather, we should add documentation about the "guarantees" between getTableDefinition and consume; in what conditions is the table definition from getTableDefinition guaranteed to be the table definition of consume? (In my mind, it should be guaranteed when you use the exact same keySpec / valueSpec due to the statefulness of them.)

@devinrsmith devinrsmith merged commit 1af5b92 into deephaven:main Aug 21, 2024
16 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2024
@deephaven-internal
Copy link
Contributor

Labels indicate documentation is required. Issues for documentation have been opened:

Community: deephaven/deephaven-docs-community#300

@robbcamera robbcamera deleted the rjc_exposeKafkaTableDefinition branch August 21, 2024 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants