Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
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

DataFrame Implementation - Serializable APIs #401

Merged
merged 22 commits into from Jan 10, 2020

Conversation

@SinghGursimran
Copy link
Contributor

SinghGursimran commented Jan 9, 2020

DataFrame implementations for all the remaining serializable APIs.

#223

For Testing:

discardContentDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.select($"content")
			.discardContentDF(Set("Content-Length: [0-9]{4}".r))
			.write
  			.option("header","true")
  			.csv("content_after_discard")

keepContentDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.select($"content")
			.keepContentDF(Set("Content-Length: [0-9]{4}".r))
			.write
  			.option("header","true")
  			.csv("content_kept")

discardUrlPatternsDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.select($"url")
			.discardUrlPatternsDF(Set(".*images.*".r))
			.show(10,false)

keepUrlPatternsDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.select($"url")
			.keepUrlPatternsDF(Set(".*images.*".r))
			.show(10,false)

discardLanguagesDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.select(DetectLanguageDF(RemoveHTMLDF($"content")).as("language"))
			.discardLanguagesDF(Set("th","de","ht"))
			.show(10,false)

keepLanguagesDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.select(DetectLanguageDF(RemoveHTMLDF($"content")).as("language"))
			.keepLanguagesDF(Set("th","de","ht"))
			.show(10,false)

keepImagesDF

import io.archivesunleashed._
import io.archivesunleashed.df._

RecordLoader.loadArchives("./src/test/resources/arc/example.arc.gz",sc)
			.all()
			.keepImagesDF()
			.select($"mime_type_tika")
			.show(10,false)
@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 9, 2020

Codecov Report

❗️ No coverage uploaded for pull request base (master@7960472). Click here to learn what that means.
The diff coverage is 88.63%.

@@            Coverage Diff            @@
##             master     #401   +/-   ##
=========================================
  Coverage          ?   77.48%           
=========================================
  Files             ?       40           
  Lines             ?     1537           
  Branches          ?      292           
=========================================
  Hits              ?     1191           
  Misses            ?      218           
  Partials          ?      128
g285sing added 2 commits Jan 10, 2020
g285sing
g285sing
@SinghGursimran SinghGursimran marked this pull request as ready for review Jan 10, 2020
@ruebot
ruebot approved these changes Jan 10, 2020
@ruebot ruebot merged commit 0ecc4f8 into archivesunleashed:master Jan 10, 2020
3 checks passed
3 checks passed
codecov/patch No report found to compare against
Details
codecov/project No report found to compare against
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.