forked from apache/gravitino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apache#1760] Fix(core): Fix bug when introducing fileset api in Cata…
…logOperationDispatcher (apache#1762) ### What changes were proposed in this pull request? Using the correct PropertiesMetadata to check the value when doing operations. ### Why are the changes needed? This is bug introduced in apache#1667 , fix it here. Fix: apache#1706 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add UTs.
- Loading branch information
Showing
4 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
core/src/test/java/com/datastrato/gravitino/TestFilesetPropertiesMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2024 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.gravitino; | ||
|
||
import com.datastrato.gravitino.catalog.PropertyEntry; | ||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.ImmutableMap; | ||
import com.google.common.collect.Maps; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class TestFilesetPropertiesMetadata extends TestBasePropertiesMetadata { | ||
|
||
public static final String TEST_FILESET_HIDDEN_KEY = "fileset_key"; | ||
|
||
private static final Map<String, PropertyEntry<?>> TEST_FILESET_PROPERTY; | ||
|
||
static { | ||
List<PropertyEntry<?>> tablePropertyMetadata = | ||
ImmutableList.of( | ||
PropertyEntry.stringPropertyEntry( | ||
TEST_FILESET_HIDDEN_KEY, | ||
"test fileset required k1 property", | ||
false, | ||
false, | ||
"test", | ||
true, | ||
false)); | ||
|
||
TEST_FILESET_PROPERTY = Maps.uniqueIndex(tablePropertyMetadata, PropertyEntry::getName); | ||
} | ||
|
||
@Override | ||
protected Map<String, PropertyEntry<?>> specificPropertyEntries() { | ||
return ImmutableMap.<String, PropertyEntry<?>>builder() | ||
.putAll(super.specificPropertyEntries()) | ||
.putAll(TEST_FILESET_PROPERTY) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters