Skip to content
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
Collaborator

@SinghGursimran 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
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 January 9, 2020 20:52
@ruebot ruebot merged commit 0ecc4f8 into archivesunleashed:master Jan 10, 2020
ruebot added a commit to archivesunleashed/aut-docs that referenced this pull request Jan 13, 2020
ianmilligan1 pushed a commit to archivesunleashed/aut-docs that referenced this pull request Jan 13, 2020
ruebot added a commit to archivesunleashed/aut-docs that referenced this pull request Jan 13, 2020
ianmilligan1 pushed a commit to archivesunleashed/aut-docs that referenced this pull request Jan 13, 2020
ruebot added a commit to archivesunleashed/aut-docs that referenced this pull request Jan 13, 2020
ianmilligan1 pushed a commit to archivesunleashed/aut-docs that referenced this pull request Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants