aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/S3SelectREADME.md
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2019-12-23 11:23:56 -0800
committerGitHub <noreply@github.com>2019-12-23 11:23:56 -0800
commita0a9f6c134e3834e46af4b09d9963498dd09500a (patch)
treed0353d9d9a2d15ce795e11ad4ba6abbd098f2f68 /weed/s3api/S3SelectREADME.md
parent8d068dc5d6f6867326ea8b26570a8d49eeb4c766 (diff)
parentfa4f599ad4657a2245f38b1300c814fbc364c385 (diff)
downloadseaweedfs-a0a9f6c134e3834e46af4b09d9963498dd09500a.tar.xz
seaweedfs-a0a9f6c134e3834e46af4b09d9963498dd09500a.zip
Merge pull request #1166 from BruceWangNo1/s3-selectorigin/s3-select
temporary s3-select feature documentation
Diffstat (limited to 'weed/s3api/S3SelectREADME.md')
-rw-r--r--weed/s3api/S3SelectREADME.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/weed/s3api/S3SelectREADME.md b/weed/s3api/S3SelectREADME.md
new file mode 100644
index 000000000..b46b5c0c0
--- /dev/null
+++ b/weed/s3api/S3SelectREADME.md
@@ -0,0 +1,47 @@
+# AWS S3 Select feature in Seaweedfs
+
+## Start weed
+
+```bash
+git checkout s3-select
+# Compile weed
+weed server -s3
+```
+
+## Install And Configure AWSCLI
+
+```bash
+pip install awscli
+aws configure // default all the way
+aws configure set default.s3.signature_version s3v4
+```
+
+## Make a bucket in S3
+
+```bash
+aws --endpoint-url http://localhost:8333 s3 mb s3://newbucketgoogle
+```
+
+## Download googleplaystore.csv
+
+Link: https://www.kaggle.com/lava18/google-play-store-apps
+
+## Copy the file to the S3 bucket
+
+```bash
+aws --endpoint-url http://localhost:8333 s3 copy google-play-store-apps/googleplaystore.csv s3://newbucketgoogle
+```
+
+## Perform S3 Select Query
+
+```bash
+aws --endpoint-url http://localhost:8333 s3api select-object-content --bucket "newbucketgoogle" --key
+ "googleplaystore.csv" --expression "select * from s3object limit 5" --expression-type 'SQL' --input-serialization '{"CSV": {"FileHeaderInfo": "USE","RecordDelimiter": "\n","FieldDelimiter": ","}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {"RecordDelimiter": "\n","FieldDelimiter": ","}}' "sample.csv"
+```
+
+## Check out result
+
+```bash
+vim sample.csv
+```
+