Ordenar
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Un ejemplo de trabajo de orden de PySpark
Muestra de código
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis webpage provides an example of a PySpark sort job using the Dataproc service.\u003c/p\u003e\n"],["\u003cp\u003eThe code sample demonstrates how to use PySpark to create an RDD, sort a list of strings, and then print the sorted list.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Dataproc requires setting up Application Default Credentials, as detailed in the provided link.\u003c/p\u003e\n"],["\u003cp\u003eThe page also links to further documentation for the Dataproc Python API and the Dataproc quickstart using client libraries.\u003c/p\u003e\n"]]],[],null,["An example PySpark sort job.\n\nCode sample \n\nPython\n\n\nBefore trying this sample, follow the Python setup instructions in the\n[Dataproc quickstart using\nclient libraries](/dataproc/docs/quickstarts/quickstart-lib).\n\n\nFor more information, see the\n[Dataproc Python API\nreference documentation](/python/docs/reference/dataproc/latest).\n\n\nTo authenticate to Dataproc, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n import pyspark\n\n sc = pyspark.SparkContext()\n rdd = sc.parallelize([\"Hello,\", \"world!\", \"dog\", \"elephant\", \"panther\"])\n words = sorted(rdd.collect())\n print(words)\n\nWhat's next\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=dataproc)."]]