changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: tweaks

changeset 543: b88bd4b0a039
parent 542: d83b4d25d5c9
child 544: ec1d4d544c36
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 13 Jul 2024 00:03:13 -0400
files: lisp/lib/dat/parquet/gen.lisp lisp/lib/dat/parquet/parquet.lisp lisp/std/bit.lisp
description: tweaks
     1.1--- a/lisp/lib/dat/parquet/gen.lisp	Fri Jul 12 22:58:59 2024 -0400
     1.2+++ b/lisp/lib/dat/parquet/gen.lisp	Sat Jul 13 00:03:13 2024 -0400
     1.3@@ -207,6 +207,13 @@
     1.4   (with-package (:dat/parquet)
     1.5     (define-parquet-class parquet-enum-object () ())
     1.6     (define-parquet-class parquet-struct-object () ())
     1.7-    (export (define-parquet-types))
     1.8+    (let ((types (define-parquet-types)))
     1.9+      (export types)
    1.10+      (deftype dat/parquet::parquet-type (&optional (designator octet-vector) optional)
    1.11+        (if optional
    1.12+            (if (eql designator 'list)
    1.13+                list
    1.14+                `(or null ,designator))
    1.15+            designator)))
    1.16     (export (mapcar 'class-name (define-parquet-structs)))
    1.17     (export *parquet-enums*)))
     2.1--- a/lisp/lib/dat/parquet/parquet.lisp	Fri Jul 12 22:58:59 2024 -0400
     2.2+++ b/lisp/lib/dat/parquet/parquet.lisp	Sat Jul 13 00:03:13 2024 -0400
     2.3@@ -66,6 +66,8 @@
     2.4 (defconstant +default-parquet-page-size+ (* 8 1024)) ;; 8kb
     2.5 (defconstant +default-parquet-row-group-size (expt 1024 3)) ;; 1gb
     2.6 
     2.7+(defvar *parquet-creator* "parquet-cl version 0.1.0")
     2.8+
     2.9 (defun parquet-write-magic (stream)
    2.10   (write-string +parquet-magic-number+ stream))
    2.11 
     3.1--- a/lisp/std/bit.lisp	Fri Jul 12 22:58:59 2024 -0400
     3.2+++ b/lisp/std/bit.lisp	Sat Jul 13 00:03:13 2024 -0400
     3.3@@ -505,6 +505,15 @@
     3.4       ((>= j end) sum)
     3.5     (setf sum (+ (aref octet-vec j) (ash sum 8)))))
     3.6 
     3.7+(defun read-little-endian (s &optional (bytes 4))
     3.8+  "Read a number in little-endian format from an byte (octet) stream S,
     3.9+the number having BYTES octets (defaulting to 4)."
    3.10+  (loop for i from 0 below bytes
    3.11+        sum (ash (read-byte s) (* 8 i))))
    3.12+
    3.13+(defun write-little-endian (i s &optional (bytes 4))
    3.14+  (write-sequence (nreverse (integer-to-octets i (* 8 bytes))) s))
    3.15+
    3.16 (defun integer-to-octets (bignum &optional (n-bits (integer-length bignum)))
    3.17   (let* ((n-bytes (ceiling n-bits 8))
    3.18          (octet-vec (make-array n-bytes :element-type '(unsigned-byte 8))))