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

[core]Add schema validation for record-level.time-field #4758

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

herefree
Copy link
Contributor

Purpose

Add schema validation for record-level.time-field

Linked issue: close #4724

Tests

API and Format

Documentation

@@ -176,6 +181,35 @@ public static void validateTableSchema(TableSchema schema) {
}
}

if (schema.options().containsKey(CoreOptions.RECORD_LEVEL_TIME_FIELD.key())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

String recordLevelTimeField = options.recordLevelTimeField();
if (recordLevelTimeField != null) {
xxx;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


@Test
public void testRecordLevelTimeField() {
Map<String, String> options = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Map<String, String> options = new HashMap<>(2);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


import static org.assertj.core.api.Assertions.assertThat;

class RecordLevelExpireTest extends PrimaryKeyTableTestBase {
@Override
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a blank line before @OverRide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


import static org.assertj.core.api.Assertions.assertThat;

class RecordLevelExpireTest extends PrimaryKeyTableTestBase {
@Override
@BeforeEach
public void beforeEachBase() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Column "col1" datatype is DataTypes.INT() in PrimaryKeyTableTestBase, but it should be DataTypes.INT().notNull() in RecordLevelExpireTest.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@wwj6591812
Copy link
Contributor

+1

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.

[Bug] Time field for record-level expire may block compaction
2 participants