Comments (2)
Hello Scott,
Thank you very much for your email and introduction.
I am not an expert in python, but I want to take a look at your python program, please share it so that I can look at it.
Thank you again!
best regards,
Mahmoud
On Feb 15, 2016, at 11:23 AM, sehunley [email protected] wrote:
When submitting a Java or Scala program, everything works fine. When submitting a python program, it's gets to the ACCEPTED state and then stalls. It eventually times out, but it's not getting picked up to run. Is this interface just for Java/Scala programs/jobs or should it be able to submit PySpark/Python jobs as well?
Thanks,
-Scott
—
Reply to this email directly or view it on GitHub #4.
from data-algorithms-book.
Hello Mahmoud,
My Python program is pretty simple, it's a sample program that came with Spark 1.6.0. Our Data Scientists are doing their Machine Learning scripts in python, hence the need to call python programatically. Here is the program:
from future import print_function
import sys
from random import random
from operator import add
from pyspark import SparkContext
if name == "main":
"""
Usage: pi [partitions]
"""
sc = SparkContext(appName="PythonPi")
partitions = int(sys.argv[1]) if len(sys.argv) > 1 else 2
n = 100000 * partitions
def f(_):
x = random() * 2 - 1
y = random() * 2 - 1
return 1 if x ** 2 + y ** 2 < 1 else 0
count = sc.parallelize(range(1, n + 1), partitions).map(f).reduce(add)
print("Pi is roughly %f" % (4.0 * count / n))
sc.stop()
Thanks in advance for any help that you can give. Here is a link to the actual output that happens when I run the code and try to submit the program above: [http://stackoverflow.com/questions/35373367/issue-submitting-a-python-application-to-yarn-from-java-code]
-Scott
from data-algorithms-book.
Related Issues (20)
- Hi am facing an issue with submit a job from java. HOT 8
- There has some empty package HOT 2
- Where is the source code for the 1st edition HOT 8
- Chapter 13, Use CombineByKey to Replace groupByKey and mapValues. HOT 1
- if can add maven pom.xml
- WikipediaKMeans.java Util where is HOT 1
- Where can we get the source codes about chapter18? HOT 1
- No source code of chapter 12 K-Means Clustering
- Chapter 23 : where can I find PearsonCorrelation on mapreduce? HOT 3
- Chap 14, the output of Builder.scala is not available for classifier.scala
- where is unit21's code src? HOT 1
- where is the data like INPUT="file://$BOOK_HOME/time_series.txt" HOT 3
- can you provide a sanbox in which sourc code can run
- where can I get source code of chapter 18,19,20,21 HOT 2
- FastaRecordReader for huge fasta files HOT 1
- Hello,dear anthor. HOT 1
- BUILD FAILED HOT 3
- Second Edition HOT 3
- Dependencies causes CVEs in your execution path
- How get data in Cochran-Armitage test for trend ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data-algorithms-book.