def read_data_page(fo, schema_helper, page_header, column_metadata,
                   dictionary):
    daph = page_header.data_page_header
    raw_bytes = _read_page(fo, page_header, column_metadata)
    io_obj = cStringIO.StringIO(raw_bytes)
    vals = []

    logger.debug("  definition_level_encoding: %s",
                 _get_name(Encoding, daph.definition_level_encoding))
    logger.debug("  repetition_level_encoding: %s",
                 _get_name(Encoding, daph.repetition_level_encoding))
    logger.debug("  encoding: %s", _get_name(Encoding, daph.encoding))

    # definition levels are skipped if data is required.
    if not schema_helper.is_required(column_metadata.path_in_schema[-1]):
        max_definition_level = schema_helper.max_definition_level(
            column_metadata.path_in_schema)
        bit_width = encoding.width_from_max_int(max_definition_level)
        logger.debug("  max def level: %s   bit_width: %s",
                     max_definition_level, bit_width)
        if bit_width == 0:
            definition_levels = [0] * daph.num_values
        else:
            definition_levels = _read_data(io_obj,
                                           daph.definition_level_encoding,
                                           daph.num_values,
                                           bit_width)

        logger.debug("  Definition levels: %s", len(definition_levels))

    # repetition levels are skipped if data is at the first level.
    if len(column_metadata.path_in_schema) > 1:
        max_repetition_level = schema_helper.max_repetition_level(
            column_metadata.path_in_schema)
        bit_width = encoding.width_from_max_int(max_repetition_level)
        repetition_levels = _read_data(io_obj,
                                       daph.repetition_level_encoding,
                                       daph.num_values)

    # TODO Actually use the definition and repetition levels.

    if daph.encoding == Encoding.PLAIN:
        for i in range(daph.num_values):
            vals.append(
                encoding.read_plain(io_obj, column_metadata.type, None))
        logger.debug("  Values: %s", len(vals))
    elif daph.encoding == Encoding.PLAIN_DICTIONARY:
        # bit_width is stored as single byte.
        bit_width = struct.unpack("<B", io_obj.read(1))[0]
        logger.debug("bit_width: %d", bit_width)
        total_seen = 0
        dict_values_bytes = io_obj.read()
        dict_values_io_obj = cStringIO.StringIO(dict_values_bytes)
        # TODO jcrobak -- not sure that this loop is needed?
        while total_seen < daph.num_values:
            values = encoding.read_rle_bit_packed_hybrid(
                dict_values_io_obj, bit_width, len(dict_values_bytes))
            if len(values) + total_seen > daph.num_values:
                values = values[0: daph.num_values - total_seen]
            vals += [dictionary[v] for v in values]
            total_seen += len(values)
    else:
        raise ParquetFormatException("Unsupported encoding: %s",
                                     _get_name(Encoding, daph.encoding))
    return vals
Read the DB connection parameters from a config file.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/parquet-python/parquet/__init__.py/read_data_page--crossover with--dataset/ETHPy150Open pivotalsoftware/pymadlib/pymadlib/pymadlib.py/DBConnect.getConnectionString