parquet.column.ColumnReader Java Examples

The following examples show how to use parquet.column.ColumnReader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OrderFilter.java    From parquet-flinktacular with Apache License 2.0 5 votes vote down vote up
public RecordFilter bind(Iterable<ColumnReader> readers) {

		return ColumnRecordFilter.column(
			"ORDERDATE",
			ColumnPredicates.applyFunctionToString(new BeforeDate())
		).bind(readers);
	}
 
Example #2
Source File: LineitemFilter.java    From parquet-flinktacular with Apache License 2.0 5 votes vote down vote up
public RecordFilter bind(Iterable<ColumnReader> readers) {

		return ColumnRecordFilter.column(
			"SHIPDATE",
			ColumnPredicates.applyFunctionToString(new AfterDate())
		).bind(readers);
	}
 
Example #3
Source File: DumpCommand.java    From parquet-tools with Apache License 2.0 5 votes vote down vote up
public static void dump(PrettyPrintWriter out, ColumnReadStoreImpl crstore, ColumnDescriptor column, long page, long total, long offset) throws IOException {
    int dmax = column.getMaxDefinitionLevel();
    ColumnReader creader = crstore.getColumnReader(column);
    out.format("*** row group %d of %d, values %d to %d ***%n", page, total, offset, offset + creader.getTotalValueCount() - 1);

    for (long i = 0, e = creader.getTotalValueCount(); i < e; ++i) {
        int rlvl = creader.getCurrentDefinitionLevel();
        int dlvl = creader.getCurrentDefinitionLevel();

        out.format("value %d: R:%d D:%d V:", offset+i, rlvl, dlvl);
        if (dlvl == dmax) {
            switch (column.getType()) {
            case BINARY:  out.format("%s", binaryToString(creader.getBinary())); break;
            case BOOLEAN: out.format("%s", creader.getBoolean()); break;
            case DOUBLE:  out.format("%s", creader.getDouble()); break;
            case FLOAT:   out.format("%s", creader.getFloat()); break;
            case INT32:   out.format("%s", creader.getInteger()); break;
            case INT64:   out.format("%s", creader.getLong()); break;
            case INT96:   out.format("%s", binaryToBigInteger(creader.getBinary())); break;
            case FIXED_LEN_BYTE_ARRAY: out.format("%s", binaryToString(creader.getBinary())); break;
            }
        } else {
            out.format("<null>");
        }

        out.println();
        creader.consume();
    }
}
 
Example #4
Source File: AvroProjectionParquetMapReduce.java    From hiped2 with Apache License 2.0 4 votes vote down vote up
@Override
public RecordFilter bind(Iterable<ColumnReader> readers) {
  return filter.bind(readers);
}