Coder Social home page Coder Social logo

kdd-cup-99-spark's Issues

what does 'sys.argv[]' mean?

Hi there,
I've found some problems when I was running your code and I couldn't understand after 7 days debugging and thinking. So I want to ask.
One is what does 'sys.argv' mean in this segment. Cause it always print the this line and quit, if I annotation the exit raw it would become an error about 'sys.argv'.
if __name__ == "__main__": if (len(sys.argv) != 3): print("Usage: /path/to/spark/bin/spark-submit --driver-memory 2g " + \ "KDDCup99.py max_k kddcup.data.file") sys.exit(1)
The second is could you please tell me what does this segment do in the code, I couldn't understand it. QUQ
if __name__ == "__main__": if (len(sys.argv) != 3): print("Usage: /path/to/spark/bin/spark-submit --driver-memory 2g " + \ "KDDCup99.py max_k kddcup.data.file") sys.exit(1) # set up environment max_k = int(sys.argv[1]) data_file = sys.argv[2] conf = SparkConf().setAppName("KDDCup99") \ #.set("spark.executor.memory", "2g") sc = SparkContext(conf=conf)

If you can answer my questions I'll be great honored. Thank you for your time.

How to solve this issue

Py4JJavaError: An error occurred while calling z:org.apache.spark.api.python.PythonRDD.collectAndServe.
: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: hdfs://quickstart.cloudera:8020/nfs/data/KDD99/kddcup.data

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.