use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testNullPostfix.
@Test
public void testNullPostfix() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator("daysSinceEpoch", "mytable", null, -1);
config.setSegmentNameGenerator(segmentNameGenerator);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable_1756015683_1756015683");
}
use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testPostfix.
@Test
public void testPostfix() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator("daysSinceEpoch", "mytable", "1", -1);
config.setSegmentNameGenerator(segmentNameGenerator);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable_1756015683_1756015683_1");
}
use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testAlreadyNamedSegment.
@Test
public void testAlreadyNamedSegment() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator("mytable_1");
config.setSegmentNameGenerator(segmentNameGenerator);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable_1");
}
use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testNullTimeColumn.
@Test
public void testNullTimeColumn() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
config.setTableName("mytable");
config.setSegmentNamePostfix("postfix");
config.setTimeColumnName(null);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable_postfix");
}
use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.
the class DefaultSegmentNameGeneratorTest method testNullTimeColumnThroughDefaultSegment.
@Test
public void testNullTimeColumnThroughDefaultSegment() throws Exception {
ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
// Build the Segment metadata.
SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator(null, "mytable", "1", 2);
config.setSegmentNameGenerator(segmentNameGenerator);
SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
Assert.assertEquals(driver.getSegmentName(), "mytable_1_2");
}
Aggregations