@Test
  public void testOrcFile11Format() throws IOException
  {
    final OrcInputFormat inputFormat = new OrcInputFormat(
        new JSONPathSpec(
            true,
            ImmutableList.of(
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "struct_list_struct_int", "$.middle.list[1].int1"),
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "struct_list_struct_intlist", "$.middle.list[*].int1"),
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "list_struct_string", "$.list[0].string1"),
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "map_struct_int", "$.map.chani.int1")
            )
        ),
        null,
        new Configuration()
    );
    final InputEntityReader reader = createReader(
        new TimestampSpec("ts", "millis", null),
        new DimensionsSpec(null),
        inputFormat,
        "example/orc-file-11-format.orc"
    );
    try (CloseableIterator<InputRow> iterator = reader.read()) {
      int actualRowCount = 0;
      // Check the first row
      Assert.assertTrue(iterator.hasNext());
      InputRow row = iterator.next();
      actualRowCount++;
      Assert.assertEquals("false", Iterables.getOnlyElement(row.getDimension("boolean1")));
      Assert.assertEquals("1", Iterables.getOnlyElement(row.getDimension("byte1")));
      Assert.assertEquals("1024", Iterables.getOnlyElement(row.getDimension("short1")));
      Assert.assertEquals("65536", Iterables.getOnlyElement(row.getDimension("int1")));
      Assert.assertEquals("9223372036854775807", Iterables.getOnlyElement(row.getDimension("long1")));
      Assert.assertEquals("1.0", Iterables.getOnlyElement(row.getDimension("float1")));
      Assert.assertEquals("-15.0", Iterables.getOnlyElement(row.getDimension("double1")));
      Assert.assertEquals("AAECAwQAAA==", Iterables.getOnlyElement(row.getDimension("bytes1")));
      Assert.assertEquals("hi", Iterables.getOnlyElement(row.getDimension("string1")));
      Assert.assertEquals("1.23456786547456E7", Iterables.getOnlyElement(row.getDimension("decimal1")));
      Assert.assertEquals("2", Iterables.getOnlyElement(row.getDimension("struct_list_struct_int")));
      Assert.assertEquals(ImmutableList.of("1", "2"), row.getDimension("struct_list_struct_intlist"));
      Assert.assertEquals("good", Iterables.getOnlyElement(row.getDimension("list_struct_string")));
      Assert.assertEquals(DateTimes.of("2000-03-12T15:00:00.0Z"), row.getTimestamp());
      while (iterator.hasNext()) {
        actualRowCount++;
        row = iterator.next();
      }
      // Check the last row
      Assert.assertEquals("true", Iterables.getOnlyElement(row.getDimension("boolean1")));
      Assert.assertEquals("100", Iterables.getOnlyElement(row.getDimension("byte1")));
      Assert.assertEquals("2048", Iterables.getOnlyElement(row.getDimension("short1")));
      Assert.assertEquals("65536", Iterables.getOnlyElement(row.getDimension("int1")));
      Assert.assertEquals("9223372036854775807", Iterables.getOnlyElement(row.getDimension("long1")));
      Assert.assertEquals("2.0", Iterables.getOnlyElement(row.getDimension("float1")));
      Assert.assertEquals("-5.0", Iterables.getOnlyElement(row.getDimension("double1")));
      Assert.assertEquals("", Iterables.getOnlyElement(row.getDimension("bytes1")));
      Assert.assertEquals("bye", Iterables.getOnlyElement(row.getDimension("string1")));
      Assert.assertEquals("1.23456786547457E7", Iterables.getOnlyElement(row.getDimension("decimal1")));
      Assert.assertEquals("2", Iterables.getOnlyElement(row.getDimension("struct_list_struct_int")));
      Assert.assertEquals(ImmutableList.of("1", "2"), row.getDimension("struct_list_struct_intlist"));
      Assert.assertEquals("cat", Iterables.getOnlyElement(row.getDimension("list_struct_string")));
      Assert.assertEquals("5", Iterables.getOnlyElement(row.getDimension("map_struct_int")));
      Assert.assertEquals(DateTimes.of("2000-03-12T15:00:01.000Z"), row.getTimestamp());
      Assert.assertEquals(7500, actualRowCount);
    }
  }
@Test
  public void testOrcFile11Format() throws IOException
  {
    final OrcInputFormat inputFormat = new OrcInputFormat(
        new JSONPathSpec(
            true,
            ImmutableList.of(
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "struct_list_struct_int", "$.middle.list[1].int1"),
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "struct_list_struct_intlist", "$.middle.list[*].int1"),
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "list_struct_string", "$.list[0].string1"),
                new JSONPathFieldSpec(JSONPathFieldType.PATH, "map_struct_int", "$.map.chani.int1")
            )
        ),
        null,
        new Configuration()
    );
    final InputEntityReader reader = createReader(
        new TimestampSpec("ts", "millis", null),
        new DimensionsSpec(null),
        inputFormat,
        "example/orc-file-11-format.orc"
    );
    try (CloseableIterator<InputRow> iterator = reader.read()) {
      int actualRowCount = 0;
     
      Assert.assertTrue(iterator.hasNext());
      InputRow row = iterator.next();
      actualRowCount++;
      Assert.assertEquals("false", Iterables.getOnlyElement(row.getDimension("boolean1")));
      Assert.assertEquals("1", Iterables.getOnlyElement(row.getDimension("byte1")));
      Assert.assertEquals("1024", Iterables.getOnlyElement(row.getDimension("short1")));
      Assert.assertEquals("65536", Iterables.getOnlyElement(row.getDimension("int1")));
      Assert.assertEquals("9223372036854775807", Iterables.getOnlyElement(row.getDimension("long1")));
      Assert.assertEquals("1.0", Iterables.getOnlyElement(row.getDimension("float1")));
      Assert.assertEquals("-15.0", Iterables.getOnlyElement(row.getDimension("double1")));
      Assert.assertEquals("AAECAwQAAA==", Iterables.getOnlyElement(row.getDimension("bytes1")));
      Assert.assertEquals("hi", Iterables.getOnlyElement(row.getDimension("string1")));
      Assert.assertEquals("1.23456786547456E7", Iterables.getOnlyElement(row.getDimension("decimal1")));
      Assert.assertEquals("2", Iterables.getOnlyElement(row.getDimension("struct_list_struct_int")));
      Assert.assertEquals(ImmutableList.of("1", "2"), row.getDimension("struct_list_struct_intlist"));
      Assert.assertEquals("good", Iterables.getOnlyElement(row.getDimension("list_struct_string")));
      Assert.assertEquals(DateTimes.of("2000-03-12T15:00:00.0Z"), row.getTimestamp());
      while (iterator.hasNext()) {
        actualRowCount++;
        row = iterator.next();
      }
     
      Assert.assertEquals("true", Iterables.getOnlyElement(row.getDimension("boolean1")));
      Assert.assertEquals("100", Iterables.getOnlyElement(row.getDimension("byte1")));
      Assert.assertEquals("2048", Iterables.getOnlyElement(row.getDimension("short1")));
      Assert.assertEquals("65536", Iterables.getOnlyElement(row.getDimension("int1")));
      Assert.assertEquals("9223372036854775807", Iterables.getOnlyElement(row.getDimension("long1")));
      Assert.assertEquals("2.0", Iterables.getOnlyElement(row.getDimension("float1")));
      Assert.assertEquals("-5.0", Iterables.getOnlyElement(row.getDimension("double1")));
      Assert.assertEquals("", Iterables.getOnlyElement(row.getDimension("bytes1")));
      Assert.assertEquals("bye", Iterables.getOnlyElement(row.getDimension("string1")));
      Assert.assertEquals("1.23456786547457E7", Iterables.getOnlyElement(row.getDimension("decimal1")));
      Assert.assertEquals("2", Iterables.getOnlyElement(row.getDimension("struct_list_struct_int")));
      Assert.assertEquals(ImmutableList.of("1", "2"), row.getDimension("struct_list_struct_intlist"));
      Assert.assertEquals("cat", Iterables.getOnlyElement(row.getDimension("list_struct_string")));
      Assert.assertEquals("5", Iterables.getOnlyElement(row.getDimension("map_struct_int")));
      Assert.assertEquals(DateTimes.of("2000-03-12T15:00:01.000Z"), row.getTimestamp());
      Assert.assertEquals(7500, actualRowCount);
    }
  }
@test public void testorcfile11format() throws ioexception { final orcinputformat inputformat = new orcinputformat( new jsonpathspec( true, immutablelist.of( new jsonpathfieldspec(jsonpathfieldtype.path, "struct_list_struct_int", "$.middle.list[1].int1"), new jsonpathfieldspec(jsonpathfieldtype.path, "struct_list_struct_intlist", "$.middle.list[*].int1"), new jsonpathfieldspec(jsonpathfieldtype.path, "list_struct_string", "$.list[0].string1"), new jsonpathfieldspec(jsonpathfieldtype.path, "map_struct_int", "$.map.chani.int1") ) ), null, new configuration() ); final inputentityreader reader = createreader( new timestampspec("ts", "millis", null), new dimensionsspec(null), inputformat, "example/orc-file-11-format.orc" ); try (closeableiterator<inputrow> iterator = reader.read()) { int actualrowcount = 0; assert.asserttrue(iterator.hasnext()); inputrow row = iterator.next(); actualrowcount++; assert.assertequals("false", iterables.getonlyelement(row.getdimension("boolean1"))); assert.assertequals("1", iterables.getonlyelement(row.getdimension("byte1"))); assert.assertequals("1024", iterables.getonlyelement(row.getdimension("short1"))); assert.assertequals("65536", iterables.getonlyelement(row.getdimension("int1"))); assert.assertequals("9223372036854775807", iterables.getonlyelement(row.getdimension("long1"))); assert.assertequals("1.0", iterables.getonlyelement(row.getdimension("float1"))); assert.assertequals("-15.0", iterables.getonlyelement(row.getdimension("double1"))); assert.assertequals("aaecawqaaa==", iterables.getonlyelement(row.getdimension("bytes1"))); assert.assertequals("hi", iterables.getonlyelement(row.getdimension("string1"))); assert.assertequals("1.23456786547456e7", iterables.getonlyelement(row.getdimension("decimal1"))); assert.assertequals("2", iterables.getonlyelement(row.getdimension("struct_list_struct_int"))); assert.assertequals(immutablelist.of("1", "2"), row.getdimension("struct_list_struct_intlist")); assert.assertequals("good", iterables.getonlyelement(row.getdimension("list_struct_string"))); assert.assertequals(datetimes.of("2000-03-12t15:00:00.0z"), row.gettimestamp()); while (iterator.hasnext()) { actualrowcount++; row = iterator.next(); } assert.assertequals("true", iterables.getonlyelement(row.getdimension("boolean1"))); assert.assertequals("100", iterables.getonlyelement(row.getdimension("byte1"))); assert.assertequals("2048", iterables.getonlyelement(row.getdimension("short1"))); assert.assertequals("65536", iterables.getonlyelement(row.getdimension("int1"))); assert.assertequals("9223372036854775807", iterables.getonlyelement(row.getdimension("long1"))); assert.assertequals("2.0", iterables.getonlyelement(row.getdimension("float1"))); assert.assertequals("-5.0", iterables.getonlyelement(row.getdimension("double1"))); assert.assertequals("", iterables.getonlyelement(row.getdimension("bytes1"))); assert.assertequals("bye", iterables.getonlyelement(row.getdimension("string1"))); assert.assertequals("1.23456786547457e7", iterables.getonlyelement(row.getdimension("decimal1"))); assert.assertequals("2", iterables.getonlyelement(row.getdimension("struct_list_struct_int"))); assert.assertequals(immutablelist.of("1", "2"), row.getdimension("struct_list_struct_intlist")); assert.assertequals("cat", iterables.getonlyelement(row.getdimension("list_struct_string"))); assert.assertequals("5", iterables.getonlyelement(row.getdimension("map_struct_int"))); assert.assertequals(datetimes.of("2000-03-12t15:00:01.000z"), row.gettimestamp()); assert.assertequals(7500, actualrowcount); } }