@Override public void load(int rowIndex, String value) { try { Date d = df.parse(value); long milliseconds = d.getTime(); mutator.set(rowIndex, milliseconds); } catch (NumberFormatException e) { throw UserException .dataReadError(e) .addContext("Failed to parse an DATE field") .addContext("Column", getName()) .addContext("Position", getIndex()) .addContext("Value", value) .build(logger); } catch (ParseException e) { throw UserException .dataReadError(e) .addContext("Date Format String does not match field value.") .addContext("Column", getName()) .addContext("Position", getIndex()) .addContext("Format String", getFormat()) .addContext("Value", value) .build(logger); } } }
@Override void addNext(int start, int index) { int intValue; if (usingDictionary) { intValue = pageReader.dictionaryValueReader.readInteger(); } else { intValue = readIntLittleEndian(bytebuf, start); } if (intValue > ParquetReaderUtility.DATE_CORRUPTION_THRESHOLD) { valueVec.getMutator().set(index, (intValue - ParquetReaderUtility.CORRECT_CORRUPT_DATE_SHIFT) * DateTimeConstants.MILLIS_PER_DAY); } else { valueVec.getMutator().set(index, intValue * (long) DateTimeConstants.MILLIS_PER_DAY); } } }
public void copyFrom(int fromIndex, int thisIndex, NullableDateVector from){ final Accessor fromAccessor = from.getAccessor(); if (!fromAccessor.isNull(fromIndex)) { mutator.set(thisIndex, fromAccessor.get(fromIndex)); } }
@Override void addNext(int start, int index) { int intValue; if (usingDictionary) { intValue = pageReader.dictionaryValueReader.readInteger(); } else { intValue = readIntLittleEndian(bytebuf, start); } valueVec.getMutator().set(index, (intValue - ParquetReaderUtility.CORRECT_CORRUPT_DATE_SHIFT) * DateTimeConstants.MILLIS_PER_DAY); }
@Override void addNext(int start, int index) { int intValue; if (usingDictionary) { intValue = pageReader.dictionaryValueReader.readInteger(); } else { intValue = readIntLittleEndian(bytebuf, start); } valueVec.getMutator().set(index, intValue * (long) DateTimeConstants.MILLIS_PER_DAY); }
public void copyFrom(int fromIndex, int thisIndex, NullableDateVector from){ final Accessor fromAccessor = from.getAccessor(); if (!fromAccessor.isNull(fromIndex)) { mutator.set(thisIndex, fromAccessor.get(fromIndex)); } }