/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.druid.segment.column;

import org.apache.druid.segment.ColumnValueSelector;
import org.apache.druid.segment.NilColumnValueSelector;
import org.apache.druid.segment.data.ReadableOffset;
import org.apache.druid.segment.vector.NilVectorSelector;
import org.apache.druid.segment.vector.ReadableVectorOffset;
import org.apache.druid.segment.vector.VectorObjectSelector;
import org.apache.druid.segment.vector.VectorSizeInspector;

import javax.annotation.Nullable;

public class UnknownTypeComplexColumn implements ComplexColumn
{
  private static final UnknownTypeComplexColumn INSTANCE = new UnknownTypeComplexColumn();

  public static UnknownTypeComplexColumn instance()
  {
    return INSTANCE;
  }

  private static final NilVectorSelector NIL_VECTOR_SELECTOR_INSTANCE =
      NilVectorSelector.create(new VectorSizeInspector()
      {
        @Override
        public int getMaxVectorSize()
        {
          return 0;
        }

        @Override
        public int getCurrentVectorSize()
        {
          return 0;
        }
      });

  @Override
  public Class<?> getClazz()
  {
    return ComplexColumn.class;
  }

  @Override
  public String getTypeName()
  {
    return "UNKNOWN_COMPLEX_COLUMN_TYPE";
  }

  @Nullable
  @Override
  public Object getRowValue(int rowNum)
  {
    return null;
  }

  @Override
  public int getLength()
  {
    return 0;
  }

  @Override
  public void close()
  {

  }

  @Override
  public ColumnValueSelector<?> makeColumnValueSelector(ReadableOffset offset)
  {
    return NilColumnValueSelector.instance();
  }

  @Override
  public VectorObjectSelector makeVectorObjectSelector(ReadableVectorOffset offset)
  {
    return NIL_VECTOR_SELECTOR_INSTANCE;
  }
}

@@ -1189,68 +1189,8 @@
 tor;
-%0Aimport org.apache.druid.segment.vector.VectorSizeInspector;
 %0A%0Aim
@@ -1465,353 +1465,8 @@
  %7D%0A%0A
-  private static final NilVectorSelector NIL_VECTOR_SELECTOR_INSTANCE =%0A      NilVectorSelector.create(new VectorSizeInspector()%0A      %7B%0A        @Override%0A        public int getMaxVectorSize()%0A        %7B%0A          return 0;%0A        %7D%0A%0A        @Override%0A        public int getCurrentVectorSize()%0A        %7B%0A          return 0;%0A        %7D%0A      %7D);%0A%0A
   @O
@@ -2092,35 +2092,39 @@
 rn N
-IL_VECTOR_SELECTOR_INSTANCE
+ilVectorSelector.create(offset)
 ;%0A  

Fix UnknownTypeComplexColumn#makeVectorObjectSelector