Skip to content

[Bug] function copyWithLatestSchema() is not correct #4957

Description

@dahai1996

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

1.0.0

Compute Engine

flink

Minimal reproduce step

no

What doesn't meet your expectations?

see :

/** TODO: this method is weird, old options will overwrite new options. */
FileStoreTable copyWithLatestSchema();

public FileStoreTable copyWithLatestSchema() {
Optional<TableSchema> optionalLatestSchema = schemaManager().latest();
if (optionalLatestSchema.isPresent()) {
Map<String, String> options = tableSchema.options();
TableSchema newTableSchema = optionalLatestSchema.get();
newTableSchema = newTableSchema.copy(options);
SchemaValidation.validateTableSchema(newTableSchema);
return copy(newTableSchema);
} else {
return this;
}
}

Map<String, String> options = tableSchema.options(); 

this line get old options,Is it because of this reason that we did not get the latest options?

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions