-
-
Save sorenmacbeth/1529424 to your computer and use it in GitHub Desktop.
Load data from a file (line by line) into HBase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn hfs-report | |
[path] | |
"Loads the log data from an HDFS path into Hbase." | |
(?<- (hbase-tap "urls" "?url-hash" "urls" "?url" "?crawl-date" | |
"?crawl-time" "?response-code" "?status" "?host") | |
[?url-hash ?url ?crawl-date ?crawl-time ?response-code ?status ?host] | |
((hfs-textline path) ?text) | |
(fetch-value-hash ?text :url :> ?url-hash) | |
(fetch-value ?text :url :> ?url) | |
(fetch-value ?text :crawl-date :> ?crawl-date) | |
(fetch-value ?text :crawl-time :> ?crawl-time) | |
(fetch-value ?text :response :> ?response-code) | |
(fetch-value ?text :status :> ?status) | |
(fetch-value ?text :host :> ?host))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment