Coder Social home page Coder Social logo

Comments (4)

bzz avatar bzz commented on June 1, 2024

Not sure if implicits are supported by py4j call - in that case we need .scala wrapper.

from jgit-spark-connector.

erizocosmico avatar erizocosmico commented on June 1, 2024
  • Python wrapper
    • Add jar automagically
    • configure DataSource
    • select/join
    • wrapper for the proposed API
  • Scala side
    • check our api works the way it was described in the document

from jgit-spark-connector.

erizocosmico avatar erizocosmico commented on June 1, 2024

I've been playing a little bit with our spark api in pyspark and it seems that we might not need the scala wrapper. Even though implicits don't work on pyspark we can always import the Implicits class and manually use it in the python wrapper.

from py4j.java_gateway import java_import

jvm = sparkSession.sparkContext._gateway.jvm

java_import(jvm, 'tech.sourced.api.Implicits')

implicits = jvm.tech.sourced.api.Implicits

sparkSession.conf.set('tech.sourced.api.repositories.path', '/siva/files/path')

reposDf = implicits.getDataSource('repositories', sparkSession._jsparkSession)
refsDf = implicits.ApiDataFrame(reposDf).getReferences()
commitsDf = implicits.ApiDataFrame(refsDf).getCommits()
filesDf = implicits.ApiDataFrame(commitsDf).getFiles()

NOTE: ApiDataFrame can only be instantiated with a Java DataFrame, so if the dataframe comes from python it needs to be implicits.ApiDataFrame(pyDf._jdf) instead.

Of course, more experimenting is needed to see if this is feasible in a real api, but it seems promising.

from jgit-spark-connector.

erizocosmico avatar erizocosmico commented on June 1, 2024

PR: #39

from jgit-spark-connector.

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.