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

remove json column v4 format writers #17625

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes
  • Loading branch information
clintropolis committed Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 511d747ad05f242000dee9bdded4f47cb670d5dd
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ public class MSQCompactionRunnerTest
private static final StringDimensionSchema STRING_DIMENSION = new StringDimensionSchema("string_dim", null, false);
private static final StringDimensionSchema MV_STRING_DIMENSION = new StringDimensionSchema("mv_string_dim", null, null);
private static final LongDimensionSchema LONG_DIMENSION = new LongDimensionSchema("long_dim");
private static final NestedDataColumnSchema NESTED_DIMENSION = new NestedDataColumnSchema("nested_dim", 4);
private static final NestedDataColumnSchema NESTED_DIMENSION = new NestedDataColumnSchema("nested_dim", 5);
private static final AutoTypeColumnSchema AUTO_DIMENSION = new AutoTypeColumnSchema("auto_dim", null);
private static final List<DimensionSchema> DIMENSIONS = ImmutableList.of(
STRING_DIMENSION,
Original file line number Diff line number Diff line change
@@ -30,9 +30,7 @@
public class NestedDataColumnSchemaTest
{
private static final DefaultColumnFormatConfig DEFAULT_CONFIG = new DefaultColumnFormatConfig(null, null);
private static final DefaultColumnFormatConfig DEFAULT_CONFIG_V4 = new DefaultColumnFormatConfig(4, null);
private static final ObjectMapper MAPPER;
private static final ObjectMapper MAPPER_V4;

static {
MAPPER = new DefaultObjectMapper();
@@ -42,22 +40,12 @@ public class NestedDataColumnSchemaTest
DEFAULT_CONFIG
)
);

MAPPER_V4 = new DefaultObjectMapper();
MAPPER_V4.setInjectableValues(
new InjectableValues.Std().addValue(
DefaultColumnFormatConfig.class,
DEFAULT_CONFIG_V4
)
);
}

@Test
public void testSerdeRoundTrip() throws JsonProcessingException
{
final NestedDataColumnSchema v4 = new NestedDataColumnSchema("test", 4);
final NestedDataColumnSchema v5 = new NestedDataColumnSchema("test", 5);
Assert.assertEquals(v4, MAPPER.readValue(MAPPER.writeValueAsString(v4), NestedDataColumnSchema.class));
Assert.assertEquals(v5, MAPPER.readValue(MAPPER.writeValueAsString(v5), NestedDataColumnSchema.class));
}

@@ -69,20 +57,11 @@ public void testSerdeDefault() throws JsonProcessingException
Assert.assertEquals(new NestedDataColumnSchema("test", 5), andBack);
}

@Test
public void testSerdeSystemDefault() throws JsonProcessingException
{
final String there = "{\"type\":\"json\", \"name\":\"test\"}";
NestedDataColumnSchema andBack = MAPPER_V4.readValue(there, NestedDataColumnSchema.class);
Assert.assertEquals(new NestedDataColumnSchema("test", 4), andBack);
}

@Test
public void testSerdeOverride() throws JsonProcessingException
{
final String there = "{\"type\":\"json\", \"name\":\"test\",\"formatVersion\":4}";
NestedDataColumnSchema andBack = MAPPER.readValue(there, NestedDataColumnSchema.class);
Assert.assertEquals(new NestedDataColumnSchema("test", 4), andBack);
Throwable t = Assert.assertThrows(DruidException.class, () -> new NestedDataColumnSchema("test", 4));
Assert.assertEquals("Unsupported nested column format version[4]", t.getMessage());
}

@Test