/** * @param readSupport Object which helps reads files of the given type, e.g. Thrift, Avro. * @param filter for filtering individual records */ public InternalParquetRecordReader(ReadSupport<T> readSupport, Filter filter) { this.readSupport = readSupport; this.filter = checkNotNull(filter, "filter"); }
/** * If this is called, the thrift class is used. * If not, will use the thrift class based on the file * metadata if a thrift class information is present. */ public Builder<T> withThriftClass(Class<T> thriftClass) { this.thriftClass = checkNotNull(thriftClass, "thriftClass"); return this; }
public static Predicate equalTo(final String target) { Preconditions.checkNotNull(target,"target"); return new Predicate() { @Override public boolean apply(ColumnReader input) { return target.equals(input.getBinary().toStringUsingUTF8()); } }; }
public FilteringGroupConverter( GroupConverter delegate, List<Integer> indexFieldPath, Map<ColumnPath, List<ValueInspector>> valueInspectorsByColumn, Map<List<Integer>, PrimitiveColumnIO> columnIOsByIndexFieldPath) { this.delegate = checkNotNull(delegate, "delegate"); this.indexFieldPath = checkNotNull(indexFieldPath, "indexFieldPath"); this.columnIOsByIndexFieldPath = checkNotNull(columnIOsByIndexFieldPath, "columnIOsByIndexFieldPath"); this.valueInspectorsByColumn = checkNotNull(valueInspectorsByColumn, "valueInspectorsByColumn"); }
protected Column(ColumnPath columnPath, Class<T> columnType) { checkNotNull(columnPath, "columnPath"); checkNotNull(columnType, "columnType"); this.columnPath = columnPath; this.columnType = columnType; }
private Builder(ReadSupport<T> readSupport, Path path) { this.readSupport = checkNotNull(readSupport, "readSupport"); this.file = checkNotNull(path, "path"); this.conf = new Configuration(); this.filter = FilterCompat.NOOP; }
/** * @param schema the schema for the file * @param keyValueMetaData the app specific metadata * @param createdBy the description of the library that created the file */ public FileMetaData(MessageType schema, Map<String, String> keyValueMetaData, String createdBy) { super(); this.schema = checkNotNull(schema, "schema"); this.keyValueMetaData = unmodifiableMap(checkNotNull(keyValueMetaData, "keyValueMetaData")); this.createdBy = createdBy; }
/** * @param schema the schema of the data * @param extraMetaData application specific metadata to add in the file */ public WriteContext(MessageType schema, Map<String, String> extraMetaData) { super(); this.schema = checkNotNull(schema, "schema"); this.extraMetaData = Collections.unmodifiableMap(checkNotNull(extraMetaData, "extraMetaData")); } /**
private Builder(Path file) { this.file = checkNotNull(file, "file"); this.conf = new Configuration(); this.filter = FilterCompat.NOOP; this.thriftClass = null; }
public static <E extends Enum> Predicate equalTo(final E target) { Preconditions.checkNotNull(target,"target"); final String targetAsString = target.name(); return new Predicate() { @Override public boolean apply(ColumnReader input) { return targetAsString.equals(input.getBinary().toStringUsingUTF8()); } }; }
/** * @param extraMetaData application specific metadata to add in the file */ public FinalizedWriteContext(Map<String, String> extraMetaData) { super(); this.extraMetaData = Collections.unmodifiableMap(checkNotNull(extraMetaData, "extraMetaData")); }
protected BinaryLogicalFilterPredicate(FilterPredicate left, FilterPredicate right) { this.left = checkNotNull(left, "left"); this.right = checkNotNull(right, "right"); String name = getClass().getSimpleName().toLowerCase(); this.toString = name + "(" + left + ", " + right + ")"; }
public static void validate(FilterPredicate predicate, MessageType schema) { checkNotNull(predicate, "predicate"); checkNotNull(schema, "schema"); predicate.accept(new SchemaCompatibilityValidator(schema)); }
private ParquetReader(Configuration conf, Path file, ReadSupport<T> readSupport, Filter filter) throws IOException { this.readSupport = readSupport; this.filter = checkNotNull(filter, "filter"); this.conf = conf; FileSystem fs = file.getFileSystem(conf); List<FileStatus> statuses = Arrays.asList(fs.listStatus(file, HiddenFileFilter.INSTANCE)); List<Footer> footers = ParquetFileReader.readAllFootersInParallelUsingSummaryFiles(conf, statuses, false); this.footersIterator = footers.iterator(); }
public static void reset(IncrementallyUpdatedFilterPredicate pred) { checkNotNull(pred, "pred"); pred.accept(INSTANCE); }
public static boolean canDrop(FilterPredicate pred, List<ColumnChunkMetaData> columns) { checkNotNull(pred, "pred"); checkNotNull(columns, "columns"); return pred.accept(new StatisticsFilter(columns)); }
protected ColumnFilterPredicate(Column<T> column, T value) { this.column = checkNotNull(column, "column"); // Eq and NotEq allow value to be null, Lt, Gt, LtEq, GtEq however do not, so they guard against // null in their own constructors. this.value = value; String name = getClass().getSimpleName().toLowerCase(); this.toString = name + "(" + column.getColumnPath().toDotString() + ", " + value + ")"; }
UserDefinedByInstance(Column<T> column, U udpInstance) { super(column); this.udpInstance = checkNotNull(udpInstance, "udpInstance"); String name = getClass().getSimpleName().toLowerCase(); this.toString = name + "(" + column.getColumnPath().toDotString() + ", " + udpInstance + ")"; }
UserDefinedByClass(Column<T> column, Class<U> udpClass) { super(column); this.udpClass = checkNotNull(udpClass, "udpClass"); String name = getClass().getSimpleName().toLowerCase(); this.toString = name + "(" + column.getColumnPath().toDotString() + ", " + udpClass.getName() + ")"; // defensively try to instantiate the class early to make sure that it's possible getUserDefinedPredicate(); }
protected final T repetition(Type.Repetition repetition) { Preconditions.checkArgument(!repetitionAlreadySet, "Repetition has already been set"); Preconditions.checkNotNull(repetition, "Repetition cannot be null"); this.repetition = repetition; this.repetitionAlreadySet = true; return self(); }