Last active
August 29, 2015 14:04
-
-
Save sohan/94d448243957442f878d to your computer and use it in GitHub Desktop.
Install cURL UDL Source on Vertica
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
#!/bin/sh | |
# Run on a vertica node. Every node needs curl at least cURL installed | |
# Install curl and gcc | |
sudo yum install -y gcc-c++ | |
sudo yum install -y curl | |
sudo yum install -y libcurl-devel | |
# `make` will fail on some libs that require Java, but will build the cURL source | |
cd /opt/vertica/sdk/examples && make | |
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 a library for cURL and add it as a UDL source. | |
* Run these commands from vsql or equivalent | |
*/ | |
CREATE LIBRARY curllib as '/opt/vertica/sdk/examples/build/cURLLib.so' | |
CREATE SOURCE curl AS LANGUAGE 'C++' NAME 'CurlSourceFactory' LIBRARY curllib |
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
/* | |
* An example of how to use your shiny new curl UDL Source. | |
*/ | |
CREATE TABLE IF NOT EXISTS rankings ( | |
pageURL VARCHAR(300), | |
pageRank INT, | |
avgDuration INT | |
) | |
COPY rankings WITH SOURCE curl(url='http://big-data-benchmark.s3.amazonaws.com/pavlo/text/tiny/rankings/part-00000') DELIMITER ',' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment