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
+-------+---------+------------------------+---------------------+------------------+---------+--------------------------------------------------------------------+ | |
| pid | datname | application_name | state | age | usename | substring | | |
+-------+---------+------------------------+---------------------+------------------+---------+--------------------------------------------------------------------+ | |
| 14482 | fleetdb | PostgreSQL JDBC Driver | idle in transaction | -00:00:00.003484 | admin | SELECT * FROM (select * from article WHERE id % 7 = 5) as article | | |
| 25066 | fleetdb | PostgreSQL JDBC Driver | idle in transaction | -00:00:00.003587 | admin | SELECT * FROM (select * from article WHERE id % 7 = 6) as article | | |
| 14485 | fleetdb | PostgreSQL JDBC Driver | active | -00:00:00.006084 | admin | SELECT * FROM (select * from article WHERE id % 7 = 3) as article | | |
| 14486 | fleetdb | PostgreSQL JDB |
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
import sys | |
import os | |
import logging | |
from awsglue.transforms import * | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.job import Job | |
from pyspark import SparkConf |
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
+-------+---------+------------------------+---------------------+------------------+---------+------------------------+ | |
| pid | datname | application_name | state | age | usename | substring | | |
+-------+---------+------------------------+---------------------+------------------+---------+------------------------+ | |
| 29189 | fleetdb | PostgreSQL JDBC Driver | idle in transaction | -00:00:00.002794 | admin | SELECT * FROM article | | |
+-------+---------+------------------------+---------------------+------------------+---------+------------------------+ |
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
import sys | |
import os | |
import logging | |
from awsglue.transforms import * | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.job import Job | |
from pyspark import SparkConf |
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
admin@fleetdb # SELECT * FROM aws_s3.query_export_to_s3( | |
'SELECT * FROM article', | |
:'s3_uri_1', | |
options :='format csv, | |
delimiter $$:$$, | |
HEADER true'); |
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
admin@fleetdb # SELECT aws_commons.create_s3_uri( | |
'fleetdb-s3', | |
'fleetdb/admin/article/article_unload', | |
'us-east-1' | |
) AS s3_uri_1 \gset | |
admin@fleetdb # \echo :s3_uri_1 | |
(fleetdb-s3,fleetdb/admin/article/article_unload,us-east-1) | |
admin@fleetdb # |
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
admin@fleetdb # CREATE EXTENSION IF NOT EXISTS aws_s3 CASCADE; | |
NOTICE: extension "aws_s3" already exists, skipping | |
CREATE EXTENSION | |
Time: 13.903 ms | |
admin@fleetdb # |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": [ | |
"glue.amazonaws.com", | |
"rds.amazonaws.com" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:Get*", | |
"s3:List*", | |
"s3:Put*", | |
"s3:DeleteObject", |
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 TABLE article ( | |
id SERIAL UNIQUE NOT NULL, | |
code VARCHAR(10) NOT NULL, | |
article TEXT, | |
name TEXT NOT NULL, | |
department VARCHAR(4) | |
); | |
insert into article ( | |
code, article, name, department |
OlderNewer