Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python - mistpy: BadParameterException #535

Open
pybala opened this issue Jan 16, 2019 · 3 comments
Open

Python - mistpy: BadParameterException #535

pybala opened this issue Jan 16, 2019 · 3 comments

Comments

@pybala
Copy link

pybala commented Jan 16, 2019

I'm getting error while trying to get the Spark Context.

from mistpy.decorators import *

@on_spark_context
def testContext(sc):
    print(sc)

testContext()

Am I missing something? why the wrapper is not passing the argument ?

Thanks,
Bala

@dos65
Copy link
Contributor

dos65 commented Jan 16, 2019

These decorators just provide information that mist uses to know what type of context function takes.
So, you want to call the function directly from python, you need to create and pass sparkContext into it.

@pybala
Copy link
Author

pybala commented Jan 17, 2019

Oh ok thanks @dos65 , then how do we share the same context across the applications.

My requirment is to share Dataframe object across applications for interactive requests. Is it possible to do this using Mist?

Thanks,
Bala

@dos65
Copy link
Contributor

dos65 commented Jan 17, 2019

Unfortunately, there aren't any built-in feature to share anything except context. Technically, it is possible to cache data on the worker process, but you need to do it on your own.

A context can be shared between several function invocation - there is shared worker-mode option for it (details: 1, 2) Actually, it means that Mist tries to reuse worker processes to not to start a new one per every function invocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants