{"size": 2419, "ext": "scrbl", "max_stars_repo_path": "scribblings/_parquet.scrbl", "max_stars_repo_name": "johnstonskj/racket-parquet", "max_stars_repo_stars_event_min_datetime": "2019-09-17T06:56:27.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-17T06:56:27.000Z", "max_issues_repo_path": "scribblings/_parquet.scrbl", "max_issues_repo_name": "johnstonskj/racket-parquet", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scribblings/_parquet.scrbl", "max_forks_repo_name": "johnstonskj/racket-parquet", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.0579710145, "max_line_length": 88, "alphanum_fraction": 0.5878462174}
#lang scribble/manual

@(require racket/sandbox
          scribble/core
          scribble/eval
          parquet
          (for-label racket/base
                     racket/contract
                     parquet))

@;{============================================================================}

@(define example-eval (make-base-eval
                      '(require racket/string
                                parquet)))

@;{============================================================================}

@title[]{Collection parquet.}
@defmodule[parquet]

TBD.

@;{============================================================================}
@section[]{File Format}

@racket[parquet/format]

@racketblock[
(define-thrift-struct file-metadata
  ([1 version required type-int32]
   [2 schema required list-of schema-element]
   [3 num-rows required type-int64]
   [4 row-groups required list-of row-group]
   [5 key-value-metadata optional list-of key-value]
   [6 created-by optional type-string]
   [7 column-orders optional list-of column-order]))
]


@;{============================================================================}
@section[]{Generated Content}

@racketblock[
(struct file-metadata (version schema num-rows row-groups key-value-metadata
                       created-by column-orders) #:transparent)

(define file-metadata/schema
  (vector
    (thrift-field 1 'version 'required 'none type-int32/decode #f #f)
    (thrift-field 2 'schema 'required 'list-of 'schema-element/decode-list #f #f)
    (thrift-field 3 'num-rows 'required 'none type-int64/decode #f #f)
    (thrift-field 4 'row-groups 'required 'list-of 'row-group/decode-list #f #f)
    (thrift-field 5 'key-value-metadata 'optional 'list-of 'key-value/decode-list #f #f)
    (thrift-field 6 'created-by 'optional 'none type-string/decode #f #f)
    (thrift-field 7 'column-orders 'optional 'list-of 'column-order/decode-list #f #f)))

(define (file-metadata/decode decoder)
  (log-parquet-info "decoding file-metadata from thrift")
  (decode-a-struct decoder file-metadata file-metadata/reverse-schema))

(define (file-metadata/decode-list decoder)
  (log-parquet-info "decoding list of file-metadata from thrift")
  (decode-a-list decoder file-metadata/decode))

(define (file-metadata/decode-set decoder)
  (log-parquet-info "decoding set of file-metadata from thrift")
  (list->set (decode-a-list decoder file-metadata/decode)))
]