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

textFiles does not filter properly #390

Closed
ruebot opened this issue Dec 17, 2019 · 0 comments · Fixed by #388
Closed

textFiles does not filter properly #390

ruebot opened this issue Dec 17, 2019 · 0 comments · Fixed by #388
Assignees

Comments

@ruebot
Copy link
Member

@ruebot ruebot commented Dec 17, 2019

Describe the bug

The conditional logic in textFiles does not filter properly. You can test with an example WARC in src/test/resources

To Reproduce

scala> import io.archivesunleashed.df._
import io.archivesunleashed.df._

scala> val arcPath = "/home/nruest/Projects/au/aut/src/test/resources/warc/example.warc.gz"
arcPath: String = /home/nruest/Projects/au/aut/src/test/resources/warc/example.warc.gz

scala>  val df = RecordLoader.loadArchives(arcPath, sc).textFiles()
df: org.apache.spark.sql.DataFrame = [url: string, filename: string ... 6 more fields]

scala> df.select("url").orderBy(desc("md5")).show(5, false)
[Stage 0:>                                                          (0 + 1) / 1]19/12/16 22:04:33 WARN PDFParser: J2KImageReader not loaded. JPEG2000 files will not be processed.
See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io
for optional dependencies.

19/12/16 22:04:33 WARN SQLite3Parser: org.xerial's sqlite-jdbc is not loaded.
Please provide the jar on your classpath to parse sqlite files.
See tika-parsers/pom.xml for the correct version.
+--------------------------------------------+                                  
|url                                         |
+--------------------------------------------+
|http://ia311518.us.archive.org/robots.txt   |
|http://ia331306.us.archive.org/robots.txt   |
|http://ia300230.us.archive.org/robots.txt   |
|http://ia360602.us.archive.org/robots.txt   |
|http://ia340915.us.archive.org/robots.txt   |
+--------------------------------------------+

Expected behavior

We should be filtering out robots.txt files, along with all js, css, html, and htm files.

Environment information

@ruebot ruebot self-assigned this Dec 17, 2019
ruebot added a commit that referenced this issue Dec 17, 2019
ruebot added a commit that referenced this issue Dec 17, 2019
- Add ExtractDateDF test
- Fix conditional logic of textFiles filter to resolve #390
- Add test for conditional logic fix for #390
- Remove cruft ExtractUrls, left over from Twitter analysis removal
(see:
https://github.com/lintool/warcbase/blob/cab311ed8b0bceb666865fa76dd3bc5a86402e13/warcbase-core/src/test/scala/org/warcbase/spark/matchbox/ExtractUrlsTest.scala)
- Tweak null/nothing on a few tests
ianmilligan1 added a commit that referenced this issue Dec 17, 2019
- Add ExtractDateDF test
- Fix conditional logic of textFiles filter to resolve #390
- Add test for conditional logic fix for #390
- Remove cruft ExtractUrls, left over from Twitter analysis removal
(see:
https://github.com/lintool/warcbase/blob/cab311ed8b0bceb666865fa76dd3bc5a86402e13/warcbase-core/src/test/scala/org/warcbase/spark/matchbox/ExtractUrlsTest.scala)
- Tweak null/nothing on a few tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.