We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, the PySpark DataFrame interface is something like:
path = "/Users/Prince/Projects/pyaut/aut/example.arc.gz" spark = SparkSession.builder.appName("filterByDate").getOrCreate() sc = spark.sparkContext df = RecordLoader.loadArchivesAsDF(path, sc, spark) filtered_df = keepDate(df, "2008", DateComponent.YYYY).filter(df['url'].like("%archive%")) rdd = filtered_df.rdd rdd.map(lambda r: (r.crawlDate, r.domain, r.url, RemoveHTML(r.contentString))) \ .saveAsTextFile("out/")
Above snipped from https://github.com/MapleOx/aut/blob/bfb2678e8f88c994f94cc0919f352303f2f1d412/src/main/python/scripts/filterByDateScript.py
We should redesign to use standard NOUN.VERB pattern, something like:
.filter(df['url'].like("%archive%")) .filter(df['date'].in(DateComponent.YYYY(2008)) .filter(df['date'].in(DateRange.YYYY(2007, 2008))) .filter(df['date'].in(DateRange.YYYYMM(2007, 1, 2008, 2))) .filter(df['date'].in(DateRange.YYYYMMDD(2007, 1, 2, 2008, 2, 2)))
The text was updated successfully, but these errors were encountered:
FYI we are writing the scripts over here on a branch of the website (documentation): https://github.com/archivesunleashed/archivesunleashed.org/blob/pyspark/content/aut/pyspark.md.
Sorry, something went wrong.
@dhop is looking into PySpark!
Resolved with 505c47a
dhop
No branches or pull requests
Currently, the PySpark DataFrame interface is something like:
Above snipped from https://github.com/MapleOx/aut/blob/bfb2678e8f88c994f94cc0919f352303f2f1d412/src/main/python/scripts/filterByDateScript.py
We should redesign to use standard NOUN.VERB pattern, something like:
The text was updated successfully, but these errors were encountered: