// Path: hive-dwrf/src/main/java/com/facebook/hive/orc/compression/CompressionKind.java
// public enum CompressionKind {
//   NONE, ZLIB, SNAPPY, LZO
// }
// 
// Path: hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/OrcLazyStruct.java
// public class OrcLazyStruct extends OrcLazyObject {
// 
//   public OrcLazyStruct(LazyStructTreeReader treeReader) {
//     super(treeReader);
//   }
// }


import static junit.framework.Assert.assertEquals;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.facebook.hive.orc.compression.CompressionKind;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.serde2.ReaderWriterProfiler;
import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspector;
import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
import org.apache.hadoop.io.Text;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import com.facebook.hive.orc.lazy.OrcLazyMap;
import com.facebook.hive.orc.lazy.OrcLazyStruct;
    }

    @Override
    public List<Object> getStructFieldsDataAsList(Object data) {
      return Arrays.asList((Object) ((MapStruct) data).getMap());
    }

  }

  @Test
  /**
   * Tests writing a Map containing only an entry with a null key.
   */
  public void testIntegerEnterLowMemoryModeAndOnNotCarriedOverStripe() throws Exception {
    ObjectInspector inspector;
    synchronized (TestMapTreeWriter.class) {
      inspector = new MapStructObjectInspector();
    }
    ReaderWriterProfiler.setProfilerOptions(conf);
    Writer writer = new WriterImpl(fs, testFilePath, conf, inspector,
        1000000, CompressionKind.NONE, 100, 10000, new MemoryManager(conf));

    Map<String, String> map = new HashMap<String, String>();
    map.put(null, null);
    // Write a map containing only a null key
    writer.addRow(new MapStruct(map));

    writer.close();
    Reader reader = OrcFile.createReader(fs, testFilePath, conf);
    RecordReader rows = reader.rows(null);
// Path: hive-dwrf/src/main/java/com/facebook/hive/orc/compression/CompressionKind.java
// public enum CompressionKind {
//   NONE, ZLIB, SNAPPY, LZO
// }
// 
// Path: hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/OrcLazyStruct.java
// public class OrcLazyStruct extends OrcLazyObject {
// 
//   public OrcLazyStruct(LazyStructTreeReader treeReader) {
//     super(treeReader);
//   }
// }


// Path: hive-dwrf/src/test/java/com/facebook/hive/orc/TestMapTreeWriter.java
import static junit.framework.Assert.assertEquals;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.facebook.hive.orc.compression.CompressionKind;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.serde2.ReaderWriterProfiler;
import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspector;
import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
import org.apache.hadoop.io.Text;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import com.facebook.hive.orc.lazy.OrcLazyMap;
import com.facebook.hive.orc.lazy.OrcLazyStruct;

    }

    @Override
    public List<Object> getStructFieldsDataAsList(Object data) {
      return Arrays.asList((Object) ((MapStruct) data).getMap());
    }

  }

  @Test
  /**
   * Tests writing a Map containing only an entry with a null key.
   */
  public void testIntegerEnterLowMemoryModeAndOnNotCarriedOverStripe() throws Exception {
    ObjectInspector inspector;
    synchronized (TestMapTreeWriter.class) {
      inspector = new MapStructObjectInspector();
    }
    ReaderWriterProfiler.setProfilerOptions(conf);
    Writer writer = new WriterImpl(fs, testFilePath, conf, inspector,
        1000000, CompressionKind.NONE, 100, 10000, new MemoryManager(conf));

    Map<String, String> map = new HashMap<String, String>();
    map.put(null, null);
    // Write a map containing only a null key
    writer.addRow(new MapStruct(map));

    writer.close();
    Reader reader = OrcFile.createReader(fs, testFilePath, conf);
    RecordReader rows = reader.rows(null);
    OrcLazyStruct lazyRow = null;