Source:
<code>private ColumnSelectorFactory makeColumnSelector(final TestFloatColumnSelector selector){ return new ColumnSelectorFactory() { @Override public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec) { final String dimensionName = dimensionSpec.getDimension(); final ExtractionFn extractionFn = dimensionSpec.getExtractionFn(); if (dimensionName.equals("dim")) { return dimensionSpec.decorate( new DimensionSelector() { @Override public IndexedInts getRow() { if (selector.getIndex() % 3 == 2) { return new ArrayBasedIndexedInts(new int[]{1}); } else { return new ArrayBasedIndexedInts(new int[]{0}); } } @Override public int getValueCardinality() { return 2; } @Override public String lookupName(int id) { switch (id) { case 0: return "a"; case 1: return "b"; default: throw new IllegalArgumentException(); } } @Override public int lookupId(String name) { switch (name) { case "a": return 0; case "b": return 1; default: throw new IllegalArgumentException(); } } } ); } else { throw new UnsupportedOperationException(); } } @Override public LongColumnSelector makeLongColumnSelector(String columnName) { throw new UnsupportedOperationException(); } @Override public FloatColumnSelector makeFloatColumnSelector(String columnName) { if (columnName.equals("value")) { return selector; } else { throw new UnsupportedOperationException(); } } @Override public ObjectColumnSelector makeObjectColumnSelector(String columnName) { throw new UnsupportedOperationException(); } @Override public ValueType columnType(String columnName) { <START> return columnName.equals("value") ? ValueType.FLOAT : null; <END> } }; }</code><technical_language>confused this logic</technical_language>

Target:
private ColumnSelectorFactory makeColumnSelector(final TestFloatColumnSelector selector){ return new ColumnSelectorFactory() { @Override public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec) { final String dimensionName = dimensionSpec.getDimension(); final ExtractionFn extractionFn = dimensionSpec.getExtractionFn(); if (dimensionName.equals("dim")) { return dimensionSpec.decorate( new DimensionSelector() { @Override public IndexedInts getRow() { if (selector.getIndex() % 3 == 2) { return new ArrayBasedIndexedInts(new int[]{1}); } else { return new ArrayBasedIndexedInts(new int[]{0}); } } @Override public int getValueCardinality() { return 2; } @Override public String lookupName(int id) { switch (id) { case 0: return "a"; case 1: return "b"; default: throw new IllegalArgumentException(); } } @Override public int lookupId(String name) { switch (name) { case "a": return 0; case "b": return 1; default: throw new IllegalArgumentException(); } } } ); } else { throw new UnsupportedOperationException(); } } @Override public LongColumnSelector makeLongColumnSelector(String columnName) { throw new UnsupportedOperationException(); } @Override public FloatColumnSelector makeFloatColumnSelector(String columnName) { if (columnName.equals("value")) { return selector; } else { throw new UnsupportedOperationException(); } } @Override public ObjectColumnSelector makeObjectColumnSelector(String columnName) { throw new UnsupportedOperationException(); } @Override public ColumnCapabilities getColumnCapabilities(String columnName) { ColumnCapabilitiesImpl caps; if (columnName.equals("value")) { caps = new ColumnCapabilitiesImpl(); caps.setType(ValueType.FLOAT); caps.setDictionaryEncoded(false); caps.setHasBitmapIndexes(false); } else { caps = new ColumnCapabilitiesImpl(); caps.setType(ValueType.STRING); caps.setDictionaryEncoded(true); caps.setHasBitmapIndexes(true); } return caps; } }; }