Skip to content

Commit

Permalink
Merge pull request #26 from civitaspo/develop
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
civitaspo authored Mar 10, 2020
2 parents 860ce66 + c903b69 commit 620f662
Show file tree
Hide file tree
Showing 33 changed files with 1,912 additions and 1,552 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: scalafmt
if: github.event.pull_request.merged == true
run: ./gradlew spotlessCheck
- name: Test with Gradle
if: github.event.pull_request.merged == true
run: ./gradlew test
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: scalafmt
run: ./gradlew spotlessCheck
- name: Test with Gradle
run: ./gradlew test

5 changes: 5 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://scalameta.org/scalafmt/#Configuration

version = "2.3.2"
newlines.alwaysBeforeElseAfterCurlyIf = true
newlines.alwaysBeforeTopLevelStatements = true
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
0.2.0 (2020-03-10)
==================

* [Enhancement] [#23](https://github.com/civitaspo/embulk-output-s3_parquet/pull/23) Limit the usage of swapping ContextClassLoader
* [BugFix] [#24](https://github.com/civitaspo/embulk-output-s3_parquet/pull/24) Use basic credentials correctly
* [Enhancement] [#20](https://github.com/civitaspo/embulk-output-s3_parquet/pull/20) Update gradle 4.1 -> 6.1
* [Enhancement] [#20](https://github.com/civitaspo/embulk-output-s3_parquet/pull/20) Update parquet-{column,common,encoding,hadoop,jackson,tools} 1.10.1 -> 1.11.0 with the latest parquet-format 2.4.0 -> 2.7.0
* [parquet-format CHANGELOG](https://github.com/apache/parquet-format/blob/master/CHANGES.md)
* [parquet-mr CHANGELOG](https://github.com/apache/parquet-mr/blob/apache-parquet-1.11.0/CHANGES.md#version-1110)
* [Enhancement] [#20](https://github.com/civitaspo/embulk-output-s3_parquet/pull/20) Update aws-java-sdk 1.11.676 -> 1.11.739
* [Enhancement] [#20](https://github.com/civitaspo/embulk-output-s3_parquet/pull/20) Update embulk 0.9.20 -> 0.9.23 with embulk-deps-{config,buffer}
* [Enhancement] [#19](https://github.com/civitaspo/embulk-output-s3_parquet/pull/19) Use scalafmt instead of the Intellij formatter.
* [Enhancement] [#19](https://github.com/civitaspo/embulk-output-s3_parquet/pull/19) Use scalafmt in CI.
* [Enhancement] [#19](https://github.com/civitaspo/embulk-output-s3_parquet/pull/19) Enable to run examples locally with some prepared scripts.

0.1.0 (2019-11-17)
==================

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,16 @@ out:
### Run example:
```shell
$ ./run_s3_local.sh
$ ./example/prepare_s3_bucket.sh
$ ./gradlew classpath
$ embulk run example/config.yml -Ilib
```

### Run test:

```shell
## Run fake S3 with localstack
$ docker run -it --rm -p 4572:4572 -e SERVICES=s3 localstack/localstack
$ ./run_s3_local.sh
$ ./gradlew test
```

Expand Down
28 changes: 19 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id "com.jfrog.bintray" version "1.1"
id "com.github.jruby-gradle.base" version "1.5.0"
id "com.adarshr.test-logger" version "1.6.0" // For Pretty test logging
id "com.diffplug.gradle.spotless" version "3.27.1"
}
import com.github.jrubygradle.JRubyExec
repositories {
Expand All @@ -13,36 +14,45 @@ configurations {
provided
}

version = "0.1.0"
version = "0.2.0"

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile "org.embulk:embulk-core:0.9.20"
provided "org.embulk:embulk-core:0.9.20"
compile "org.embulk:embulk-core:0.9.23"
provided "org.embulk:embulk-core:0.9.23"

compile 'org.scala-lang:scala-library:2.13.1'
['glue', 's3', 'sts'].each { v ->
compile "com.amazonaws:aws-java-sdk-${v}:1.11.676"
compile "com.amazonaws:aws-java-sdk-${v}:1.11.739"
}
['column', 'common', 'encoding', 'format', 'hadoop', 'jackson'].each { v ->
compile "org.apache.parquet:parquet-${v}:1.10.1"
['column', 'common', 'encoding', 'hadoop', 'jackson'].each { v ->
compile "org.apache.parquet:parquet-${v}:1.11.0"
}
// ref. https://github.com/apache/parquet-mr/blob/apache-parquet-1.11.0/pom.xml#L85
compile 'org.apache.parquet:parquet-format:2.7.0'
compile 'org.apache.hadoop:hadoop-common:2.9.2'
compile 'org.xerial.snappy:snappy-java:1.1.7.3'

['test', 'standards', 'deps-buffer', 'deps-config'].each { v ->
testCompile "org.embulk:embulk-${v}:0.9.23"
}
testCompile 'org.scalatest:scalatest_2.13:3.0.8'
testCompile 'org.embulk:embulk-test:0.9.20'
testCompile 'org.embulk:embulk-standards:0.9.20'
testCompile 'org.apache.parquet:parquet-tools:1.10.1'
testCompile 'org.apache.parquet:parquet-tools:1.11.0'
testCompile 'org.apache.hadoop:hadoop-client:2.9.2'
}

testlogger {
theme "mocha"
}

spotless {
scala {
scalafmt('2.3.2').configFile('.scalafmt.conf')
}
}

task classpath(type: Copy, dependsOn: ["jar"]) {
doFirst { file("classpath").deleteDir() }
from (configurations.runtime - configurations.provided + files(jar.archivePath))
Expand Down
4 changes: 3 additions & 1 deletion example/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ in:

out:
type: s3_parquet
bucket: my-bucket
bucket: example
region: us-east-1
endpoint: http://127.0.0.1:4572
path_prefix: path/to/my-obj.
file_ext: snappy.parquet
compression_codec: snappy
Expand Down
6 changes: 6 additions & 0 deletions example/prepare_s3_bucket.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

aws s3 mb s3://example \
--endpoint-url http://localhost:4572 \
--region us-east-1

4 changes: 3 additions & 1 deletion example/with_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ in:

out:
type: s3_parquet
bucket: dev-baikal-workspace
bucket: example
region: us-east-1
endpoint: http://127.0.0.1:4572
path_prefix: path/to/my-obj-2.
file_ext: snappy.parquet
compression_codec: snappy
Expand Down
4 changes: 3 additions & 1 deletion example/with_logicaltypes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ in:

out:
type: s3_parquet
bucket: my-bucket
bucket: example
region: us-east-1
endpoint: http://127.0.0.1:4572
path_prefix: path/to/my-obj-2.
file_ext: snappy.parquet
compression_codec: snappy
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
51 changes: 31 additions & 20 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down Expand Up @@ -138,19 +154,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -159,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
7 changes: 7 additions & 0 deletions run_s3_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

docker run -it -d --rm \
-p 4572:4572 \
-e SERVICES=s3 \
localstack/localstack

Loading

0 comments on commit 620f662

Please sign in to comment.