Last active
January 3, 2016 11:19
-
-
Save dharkum/8455163 to your computer and use it in GitHub Desktop.
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
CREATE EXTERNAL TABLE IF NOT EXISTS WebFeeds | |
( | |
UserID int, | |
Message String | |
) | |
ROW FORMAT DELIMITED | |
FIELDS TERMINATED BY ',' | |
STORED AS TEXTFILE | |
LOCATION 'wasb://install@myprimarystorage.blob.core.windows.net/webfeeds'; | |
CREATE EXTERNAL TABLE IF NOT EXISTS ProcessedWebFeeds | |
( | |
UserID int, | |
PhoneNumber String | |
) | |
ROW FORMAT DELIMITED | |
FIELDS TERMINATED BY ',' | |
STORED AS TEXTFILE | |
LOCATION 'wasb://install@myprimarystorage.blob.core.windows.net/processedwebfeeds'; | |
CREATE TEMPORARY FUNCTION FindPat AS 'HiveUDF.FindPattern'; | |
INSERT INTO TABLE ProcessedWebFeeds | |
SELECT UserID, FindPat(Message, '\\d{3}-\\d{7}') AS PhoneNumber | |
FROM WebFeeds; | |
SELECT * FROM ProcessedWebFeeds; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment