Code Monkey home page Code Monkey logo

Comments (5)

mjakubowski84 avatar mjakubowski84 commented on July 20, 2024 1

You are right! It turns out that overwrite mode has never been implemented in viaParquet. And to implement it properly, validateWritePath has to be modified, too.

from parquet4s.

mjakubowski84 avatar mjakubowski84 commented on July 20, 2024

Hi @jhenahan,

I am not sure what's going on. Parquet4s, by design, deletes the whole directory indicated in .write(Path(prefix)) when override mode is in use.
I recommend turning on debug logs. Maybe there's an issue with permissions?

from parquet4s.

jhenahan avatar jhenahan commented on July 20, 2024

Digging through logs, it looks like viaParquet never calls io.validateWritePath, so the rotating writer never deletes filesystems. writeSingleFile does, but can't write partitioned data. I think it might be sufficient to call validateWritePath in rotatingWriter's write definition, but I'm not sure. I'll try it out locally, but if you know better I'm very happy to take some pointers and write a PR.

from parquet4s.

jhenahan avatar jhenahan commented on July 20, 2024
diff --git i/fs2/src/main/scala/com/github/mjakubowski84/parquet4s/parquet/rotatingWriter.scala w/fs2/src/main/scala/com/github/mjakubowski84/parquet4s/parquet/rotatingWriter.scala
index a60f59a..0baadcb 100644
--- i/fs2/src/main/scala/com/github/mjakubowski84/parquet4s/parquet/rotatingWriter.scala
+++ w/fs2/src/main/scala/com/github/mjakubowski84/parquet4s/parquet/rotatingWriter.scala
@@ -517,6 +517,7 @@ object rotatingWriter {
         logger     <- Stream.eval(logger[F](this.getClass))
         eventQueue <- Stream.eval(Queue.unbounded[F, WriterEvent[F, T, W]])
         writersRef <- Stream.eval(Ref.of(Map.empty[Path, RecordWriter[F]]))
+        _          <- Stream.eval(io.validateWritePath[F](basePath, options, logger))
         rotatingWriter <- Stream.emit(
           new RotatingWriter[T, W, F](
             basePath            = basePath,

This is my local diff. Initial testing looks promising. :)

from parquet4s.

mjakubowski84 avatar mjakubowski84 commented on July 20, 2024

The fix released is released in v2.9.0

from parquet4s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.