public ColumnHolder build() { Preconditions.checkState(type != null, "Type must be set."); return new SimpleColumnHolder( new ColumnCapabilitiesImpl() .setType(type) .setDictionaryEncoded(dictionaryEncoded) .setHasBitmapIndexes(bitmapIndex != null) .setHasSpatialIndexes(spatialIndex != null) .setHasMultipleValues(hasMultipleValues) .setFilterable(filterable), columnSupplier, bitmapIndex, spatialIndex ); } }
capabilities.setHasSpatialIndexes(true); } else { DimensionHandler handler = DimensionHandlerUtils.getHandlerFromCapabilities(
@Test(expected = IllegalArgumentException.class) public void testCloser() throws Exception { final long timestamp = System.currentTimeMillis(); IncrementalIndex toPersist = IncrementalIndexTest.createIndex(null); IncrementalIndexTest.populateIndex(timestamp, toPersist); ColumnCapabilitiesImpl capabilities = (ColumnCapabilitiesImpl) toPersist.getCapabilities("dim1"); capabilities.setHasSpatialIndexes(true); final File tempDir = temporaryFolder.newFolder(); final File v8TmpDir = new File(tempDir, "v8-tmp"); final File v9TmpDir = new File(tempDir, "v9-tmp"); try { indexMerger.persist(toPersist, tempDir, indexSpec, null); } finally { if (v8TmpDir.exists()) { Assert.fail("v8-tmp dir not clean."); } if (v9TmpDir.exists()) { Assert.fail("v9-tmp dir not clean."); } } }
TestColumn(ValueType type) { columnCapabilities = new ColumnCapabilitiesImpl() .setType(type) .setDictionaryEncoded(type == ValueType.STRING) // set a fake value to make string columns .setHasBitmapIndexes(type == ValueType.STRING) .setHasSpatialIndexes(false) .setHasMultipleValues(false); }
@Test public void testSerde() throws Exception { String json = mapper.writeValueAsString(new ColumnCapabilitiesImpl() .setDictionaryEncoded(true) .setHasBitmapIndexes(true) .setHasMultipleValues(true) .setHasSpatialIndexes(true) .setType(ValueType.COMPLEX) .setFilterable(true)); Assert.assertFalse(json.contains("filterable")); ColumnCapabilities cc = mapper.readValue(json, ColumnCapabilitiesImpl.class); Assert.assertEquals(ValueType.COMPLEX, cc.getType()); Assert.assertTrue(cc.isDictionaryEncoded()); Assert.assertFalse(cc.isRunLengthEncoded()); Assert.assertTrue(cc.hasSpatialIndexes()); Assert.assertTrue(cc.hasMultipleValues()); Assert.assertTrue(cc.hasBitmapIndexes()); Assert.assertFalse(cc.isFilterable()); }
public ColumnHolder build() { Preconditions.checkState(type != null, "Type must be set."); return new SimpleColumnHolder( new ColumnCapabilitiesImpl() .setType(type) .setDictionaryEncoded(dictionaryEncoded) .setHasBitmapIndexes(bitmapIndex != null) .setHasSpatialIndexes(spatialIndex != null) .setHasMultipleValues(hasMultipleValues) .setFilterable(filterable), columnSupplier, bitmapIndex, spatialIndex ); } }
capabilities.setHasSpatialIndexes(true); } else { DimensionHandler handler = DimensionHandlerUtils.getHandlerFromCapabilities(