-
Notifications
You must be signed in to change notification settings - Fork 15
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: Streaming Tunnel supports Schema Evolution and provides related examples #38
Conversation
@@ -54,6 +61,21 @@ func (rsw *RecordPackStreamWriter) Append(record data.Record) error { | |||
return errors.WithStack(err) | |||
} | |||
|
|||
func checkIfRecordSchemaMatchSessionSchema(record *data.Record, schema []tableschema.Column) error { | |||
if record.Len() != len(schema) { | |||
return errors.New(fmt.Sprintf("Record schema not match session schema, record len: %d, session schema len: %d", |
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.
直接用errors.Errorf方法
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.
Done.
for index, recordData := range *record { | ||
colType := schema[index].Type.ID() | ||
if recordData != nil && recordData.Type().ID() != colType { | ||
return errors.New(fmt.Sprintf("Record schema not match session schema, index: %d, record type: %s, session schema type: %s", |
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.
直接用errors.Errorf方法
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.
Done.
@@ -36,12 +36,15 @@ type sessionConfig struct { | |||
// Columns for stream upload session only | |||
Columns []string | |||
SchemaVersion int | |||
// AllowSchemaMismatch for stream upload session only | |||
AllowSchemaMismatch bool |
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.
将AllowScheamaMismatch的配置项的作用添加到 CreateStreamUploadSession方法的注释里
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.
Done.
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.
pr38, 37,36 内容重合了,应该只留pr38就可以
refactor: rename httpNotOk to httpError
a3296bd
to
ac1fafe
Compare
No description provided.