-
Notifications
You must be signed in to change notification settings - Fork 1k
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
chore: inject schema using schema id for cas #8441
Conversation
5e6f5a5
to
ce28161
Compare
* <ul> | ||
* <li>The statement is a CT/CS.</li> | ||
* <li>The statement does not defined any key columns.</li> | ||
* <li>The statement does not defined any key columns or has KEY_SCHEMA_ID property set</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If KEY_SCHEMA_ID
is set, then no key columns must be defined either, right? Could you update the line?
* <ul> | ||
* <li>The statement is a CT/CS.</li> | ||
* <li>The statement does not defined any key columns.</li> | ||
* <li>The statement does not defined any key columns or has KEY_SCHEMA_ID property set</li> | ||
* <li>The key format of the statement supports schema inference.</li> | ||
* </ul> | ||
* And similarly for value columns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VALUE_SCHEMA_ID
is the property in the case of value columns, right? Can you update the doc?
id = srClient.getLatestSchemaMetadata(subject).getId(); | ||
} | ||
|
||
final ParsedSchema schema = srClient.getSchemaBySubjectAndId(subject, id); | ||
return fromParsedSchema(topicName, id, schema, expectedFormat, serdeFeatures, isKey, | ||
schemaId.isPresent()); | ||
return fromParsedSchema(topicName, id, schemaId, schema, expectedFormat, serdeFeatures, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id
and schemaId
are the same. Can this become into one parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take a look how to refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually schemaId
is optional and is used to indicate whether schemaId is provided by user to fetched from latest schema. Maybe I can refactor to call it isIdProvided
containsString("Error serializing message to topic: bob. " | ||
+ "Failed to serialize Protobuf data from topic bob")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to know what's the real error? Is this a partial error btw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually dependent PR's code and removed. Let me rebase this PR...
5412f7e
to
14c925e
Compare
PersistenceSchema.from(schema, serdeFeatures) | ||
); | ||
int id = SchemaRegistryUtil.registerSchema(srClient, parsedSchema, topic, subject, isKey); | ||
System.out.print("h"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this print an accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove
final ParsedSchema parsedSchema = translator.toParsedSchema( | ||
PersistenceSchema.from(schema, serdeFeatures) | ||
); | ||
int id = SchemaRegistryUtil.registerSchema(srClient, parsedSchema, topic, subject, isKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you do with the id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove
int id = srClient.register(KsqlConstants.getSRSubject(topic.getName(), true), schema); | ||
System.out.print("h"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the id
use? What about the print call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove
this.testCase = requireNonNull(testCase, "testCase"); | ||
} | ||
|
||
@Test | ||
public void shouldBuildAndExecuteQueries() { | ||
if (!testCase.getName().contains("DECIMAL - key - inference - default precision")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this usd for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Will remove
@@ -7,7 +7,7 @@ | |||
"CREATE STREAM INPUT (K STRING KEY, foo INT) WITH (WRAP_SINGLE_VALUE=true, kafka_topic='input', value_format='KAFKA');" | |||
], | |||
"expectedException": { | |||
"type": "io.confluent.ksql.util.KsqlStatementException", | |||
"type": "io.confluent.ksql.util.KsqlException", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the KsqlStatementException
stay? There is a check at the end of the KsqlResource.handleKsqlStatements()
method that returns a different value depending on the exception.
This question applies for the rest of the tests that changes to this new exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Will catch KsqlException
and rethrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
a12401a
to
7b69541
Compare
7b69541
to
85415a7
Compare
Description
SchemaRegisterInjector
as well.Testing done
Reviewer checklist