Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
packages:
.
dataframe-fastcsv
packages: .
6 changes: 4 additions & 2 deletions dataframe.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ common warnings
library
import: warnings
default-extensions: Strict
exposed-modules: DataFrame,
exposed-modules:
DataFrame,
DataFrame.Lazy,
DataFrame.Functions,
DataFrame.Synthesis,
Expand Down Expand Up @@ -111,7 +112,8 @@ library
DataFrame.Typed.TH,
DataFrame.Typed.Expr,
DataFrame.Typed.Lazy,
DataFrame.Typed
DataFrame.Typed,
DataFrame.IO.Parquet.Writer
build-depends: base >= 4 && <5,
deepseq >= 1 && < 2,
aeson >= 0.11.0.0 && < 3,
Expand Down
18 changes: 18 additions & 0 deletions src/DataFrame/IO/Parquet/Writer.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module DataFrame.IO.Parquet.Writer (writeParquet) where

import qualified Data.ByteString.Builder as B
import System.IO (IOMode(WriteMode), withBinaryFile)

-- Using the path we found with grep
import DataFrame.Internal.DataFrame (DataFrame)

-- | Minimalist implementation to verify the build system works
writeParquet :: FilePath -> DataFrame -> IO ()
writeParquet path _df = do
withBinaryFile path WriteMode $ \handle -> do
-- Every Parquet file MUST start and end with these 4 bytes
B.hPutBuilder handle (B.string8 "PAR1")

-- (Logic for RowGroups will go here later)

B.hPutBuilder handle (B.string8 "PAR1")