This file contains hidden or 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
MariaDB [test]> SELECT * FROM goods_status; | |
+------+--------+----------+ | |
| id_g | status | category | | |
+------+--------+----------+ | |
| 1 | 1 | 101 | | |
| 2 | 1 | 120 | | |
| 3 | 2 | 120 | | |
| 4 | 2 | 101 | | |
| 5 | 3 | 101 | | |
| 6 | 3 | 120 | |
This file contains hidden or 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
{ | |
"fileLocations": [ | |
{ | |
"URIPrefixes": [ | |
"https://s3-ap-northeast-1.amazonaws.com/your-bucket-name/dir/" | |
] | |
} | |
], | |
"globalUploadSettings": { | |
"format": "CSV", |
This file contains hidden or 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
iex(24)> 1 or true | |
** (BadBooleanError) expected a boolean on left-side of "or", got: 1 | |
iex(19)> 1 and true | |
** (BadBooleanError) expected a boolean on left-side of "and", got: 1 | |
iex(19)> true and 1 | |
1 | |
This file contains hidden or 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
var materials = [ | |
'test1', | |
'aaaa', | |
'hogehogheo', | |
'wwawawawawa' | |
]; | |
materials.map(test); | |
// expected output: Array [8, 6, 7, 9] | |
function test(value) { |
This file contains hidden or 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
特定のS3バケットへのアクセス許可 | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "S3ACCESS01", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:PutObject", | |
"s3:PutObjectAcl", |
This file contains hidden or 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
defmodule Wandbox do | |
def hello() do | |
IO.write "Hello, " | |
IO.puts "World, Wandbox!" | |
IO.inspect "debug" | |
IO.inspect Foo.x | |
IO.puts Foo.x | |
IO.inspect("hoge") | |
IO.puts "-----" | |
This file contains hidden or 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 test_db.test_table ( | |
`test_date` date, | |
`test_id` string, | |
`test_num` int | |
) | |
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' | |
WITH SERDEPROPERTIES ( | |
'serialization.format' = ',', | |
'field.delim' = ',' | |
) LOCATION 's3://test-bucket/test-folder/' |
This file contains hidden or 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
# S3バケット内のファイルコピー | |
def athena_query_result_copy(target_bucket, target_key, output_bucket, output_key): | |
s3client = boto3.client('s3') | |
s3client.copy_object( | |
Bucket=output_bucket, | |
Key=output_key, | |
CopySource={ | |
'Bucket': target_bucket, | |
'Key': target_key |
This file contains hidden or 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 boto3 | |
import os | |
import time | |
from datetime import datetime | |
from datetime import timedelta | |
def lambda_handler(event, context): | |
query = build_query() | |
target_db = os.environ['TARGET_DB'] |
This file contains hidden or 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
centosへのインストール(Python3がインストールされていること) | |
https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/cli-chap-install.html | |
$ pip3 install awscli --upgrade --user | |
コンフィグ設定 | |
aws configure --profile dev | |
AWS Access Key ID [None]: hogehoge | |
AWS Secret Access Key [None]: hogehoge |