use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testOnlyTableName.
@Test
public void testOnlyTableName() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator(null, "mytable", null, -1);
config.setSegmentNameGenerator(segmentNameGenerator);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable");
}
use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testNullPostfixWithNonNegSequenceId.
@Test
public void testNullPostfixWithNonNegSequenceId() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator("daysSinceEpoch", "mytable", null, 2);
config.setSegmentNameGenerator(segmentNameGenerator);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable_1756015683_1756015683_2");
}
Aggregations