diff --git a/cabal.project b/cabal.project index 133bec4..5356e76 100644 --- a/cabal.project +++ b/cabal.project @@ -1,3 +1 @@ -packages: - . - dataframe-fastcsv +packages: . \ No newline at end of file diff --git a/dataframe.cabal b/dataframe.cabal index 95c8042..8a2c8f6 100644 --- a/dataframe.cabal +++ b/dataframe.cabal @@ -46,7 +46,8 @@ common warnings library import: warnings default-extensions: Strict - exposed-modules: DataFrame, + exposed-modules: + DataFrame, DataFrame.Lazy, DataFrame.Functions, DataFrame.Synthesis, @@ -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, diff --git a/src/DataFrame/IO/Parquet/Writer.hs b/src/DataFrame/IO/Parquet/Writer.hs new file mode 100644 index 0000000..eb8e00b --- /dev/null +++ b/src/DataFrame/IO/Parquet/Writer.hs @@ -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") \ No newline at end of file