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: Streaming Tunnel supports Schema Evolution and provides related examples #38

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

dingxin-tech
Copy link
Collaborator

No description provided.

@@ -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",
Copy link
Collaborator

Choose a reason for hiding this comment

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

直接用errors.Errorf方法

Copy link
Collaborator Author

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",
Copy link
Collaborator

Choose a reason for hiding this comment

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

直接用errors.Errorf方法

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

将AllowScheamaMismatch的配置项的作用添加到 CreateStreamUploadSession方法的注释里

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@fetchadd fetchadd left a 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就可以

@fetchadd fetchadd merged commit acf10f7 into aliyun:master Oct 30, 2024
1 of 2 checks passed
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