List<HiveWritableRecord> writeRecords = Lists.newArrayList();
HiveWritableRecord r1 = HiveRecordFactory.newWritableRecord(schema);
writeRecords.add(r1);
HiveReadableRecord readRecord;
r1.set(1, (byte) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getShort(1));
recreateTable();
r1.set(1, (short) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getShort(1));
recreateTable();
r1.set(2, (byte) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getInt(2));
recreateTable();
r1.set(2, (short) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getInt(2));
recreateTable();
r1.set(2, 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getInt(2));
recreateTable();
r1.set(3, (byte) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getLong(3));
recreateTable();
r1.set(3, (short) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getLong(3));
recreateTable();
r1.set(3, 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getLong(3));
recreateTable();
r1.set(3, 4L);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getLong(3));
recreateTable();
r1.set(4, (byte) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getFloat(4), DELTA);
recreateTable();
r1.set(4, (short) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getFloat(4), DELTA);
recreateTable();
r1.set(4, 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getFloat(4), DELTA);
recreateTable();
r1.set(4, 4L);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getFloat(4), DELTA);
recreateTable();
r1.set(4, 4.2f);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4.2, readRecord.getFloat(4), DELTA);
recreateTable();
r1.set(5, (byte) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getDouble(5), DELTA);
recreateTable();
r1.set(5, (short) 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getDouble(5), DELTA);
recreateTable();
r1.set(5, 4);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getDouble(5), DELTA);
recreateTable();
r1.set(5, 4L);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4, readRecord.getDouble(5), DELTA);
recreateTable();
r1.set(5, 4.2f);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4.2, readRecord.getDouble(5), DELTA);
recreateTable();
r1.set(5, 4.2d);
HiveOutput.writeTable(outputDesc, writeRecords);
readRecord = readSingleRecord(inputDesc);
assertEquals(4.2, readRecord.getDouble(5), DELTA);
}