embulk-filter-typecast 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/build.gradle +3 -3
- data/gradle/wrapper/gradle-wrapper.properties +2 -2
- data/src/main/java/org/embulk/filter/typecast/ColumnCaster.java +2 -2
- data/src/main/java/org/embulk/filter/typecast/TypecastFilterPlugin.java +0 -4
- data/src/test/java/org/embulk/filter/typecast/cast/TestStringCast.java +1 -4
- data/src/test/java/org/embulk/filter/typecast/cast/TestTimestampCast.java +1 -4
- metadata +13 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d936b48df269ca51c971f2f258c2ae54abd492b5
|
4
|
+
data.tar.gz: 7611a81214e865fb9f63ab3d346f45b4e2d68063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588142a7396f9a03ac3820276e5cf213345bb0674e72364faba6f0de26157d3184c16edee9d7b874fc2b0a7e73305661a74cc5f81819568c12d3c7b0d127032b
|
7
|
+
data.tar.gz: 6806eff6b7f631388ca2946b2a8732b824f40418b9e347fc674c9616e4cff1741278da825a3a8f2b8e987626d27dc6bc0c154bf86f71d8d459d0ea956e11ba54
|
data/CHANGELOG.md
CHANGED
data/build.gradle
CHANGED
@@ -13,13 +13,13 @@ configurations {
|
|
13
13
|
provided
|
14
14
|
}
|
15
15
|
|
16
|
-
version = "0.
|
16
|
+
version = "0.2.0"
|
17
17
|
sourceCompatibility = 1.7
|
18
18
|
targetCompatibility = 1.7
|
19
19
|
|
20
20
|
dependencies {
|
21
|
-
compile "org.embulk:embulk-core:0.8
|
22
|
-
provided "org.embulk:embulk-core:0.8
|
21
|
+
compile "org.embulk:embulk-core:0.8.29+"
|
22
|
+
provided "org.embulk:embulk-core:0.8.29+"
|
23
23
|
compile "io.github.medjed:JsonPathCompiler:0.1.1"
|
24
24
|
|
25
25
|
testCompile "junit:junit:4.+"
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#Wed
|
1
|
+
#Wed Aug 09 13:08:20 JST 2017
|
2
2
|
distributionBase=GRADLE_USER_HOME
|
3
3
|
distributionPath=wrapper/dists
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
5
5
|
zipStorePath=wrapper/dists
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
6
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
@@ -95,14 +95,14 @@ class ColumnCaster
|
|
95
95
|
{
|
96
96
|
DateTimeZone timezone = columnConfig.getTimeZone().or(task.getDefaultTimeZone());
|
97
97
|
String format = columnConfig.getFormat().or(task.getDefaultTimestampFormat());
|
98
|
-
return new TimestampParser(
|
98
|
+
return new TimestampParser(format, timezone);
|
99
99
|
}
|
100
100
|
|
101
101
|
private TimestampFormatter getTimestampFormatter(ColumnConfig columnConfig, PluginTask task)
|
102
102
|
{
|
103
103
|
String format = columnConfig.getFormat().or(task.getDefaultTimestampFormat());
|
104
104
|
DateTimeZone timezone = columnConfig.getTimeZone().or(task.getDefaultTimeZone());
|
105
|
-
return new TimestampFormatter(
|
105
|
+
return new TimestampFormatter(format, timezone);
|
106
106
|
}
|
107
107
|
|
108
108
|
public void setFromBoolean(Column outputColumn, boolean value)
|
@@ -22,7 +22,6 @@ import org.embulk.spi.Schema;
|
|
22
22
|
import org.embulk.spi.type.TimestampType;
|
23
23
|
import org.embulk.spi.type.Type;
|
24
24
|
import org.joda.time.DateTimeZone;
|
25
|
-
import org.jruby.embed.ScriptingContainer;
|
26
25
|
import org.slf4j.Logger;
|
27
26
|
|
28
27
|
import java.util.List;
|
@@ -70,9 +69,6 @@ public class TypecastFilterPlugin implements FilterPlugin
|
|
70
69
|
@Config("default_timestamp_format")
|
71
70
|
@ConfigDefault("\"%Y-%m-%d %H:%M:%S.%N %z\"")
|
72
71
|
public String getDefaultTimestampFormat();
|
73
|
-
|
74
|
-
@ConfigInject
|
75
|
-
ScriptingContainer getJRuby();
|
76
72
|
}
|
77
73
|
|
78
74
|
@Override
|
@@ -5,7 +5,6 @@ import org.embulk.spi.DataException;
|
|
5
5
|
import org.embulk.spi.time.Timestamp;
|
6
6
|
import org.embulk.spi.time.TimestampParser;
|
7
7
|
import org.joda.time.DateTimeZone;
|
8
|
-
import org.jruby.embed.ScriptingContainer;
|
9
8
|
import org.junit.Before;
|
10
9
|
import org.junit.Rule;
|
11
10
|
import org.junit.Test;
|
@@ -20,12 +19,10 @@ public class TestStringCast
|
|
20
19
|
{
|
21
20
|
@Rule
|
22
21
|
public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
|
23
|
-
public ScriptingContainer jruby;
|
24
22
|
|
25
23
|
@Before
|
26
24
|
public void createResource()
|
27
25
|
{
|
28
|
-
jruby = new ScriptingContainer();
|
29
26
|
}
|
30
27
|
|
31
28
|
@Test
|
@@ -102,7 +99,7 @@ public class TestStringCast
|
|
102
99
|
public void asTimestamp()
|
103
100
|
{
|
104
101
|
Timestamp expected = Timestamp.ofEpochSecond(1463084053, 123456000);
|
105
|
-
TimestampParser parser = new TimestampParser(
|
102
|
+
TimestampParser parser = new TimestampParser("%Y-%m-%d %H:%M:%S.%N", DateTimeZone.UTC);
|
106
103
|
assertEquals(expected, StringCast.asTimestamp("2016-05-12 20:14:13.123456", parser));
|
107
104
|
|
108
105
|
try {
|
@@ -6,7 +6,6 @@ import org.embulk.spi.time.Timestamp;
|
|
6
6
|
import org.embulk.spi.time.TimestampFormatter;
|
7
7
|
import org.embulk.spi.time.TimestampParser;
|
8
8
|
import org.joda.time.DateTimeZone;
|
9
|
-
import org.jruby.embed.ScriptingContainer;
|
10
9
|
import org.junit.Before;
|
11
10
|
import org.junit.Rule;
|
12
11
|
import org.junit.Test;
|
@@ -21,14 +20,12 @@ public class TestTimestampCast
|
|
21
20
|
{
|
22
21
|
@Rule
|
23
22
|
public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
|
24
|
-
public ScriptingContainer jruby;
|
25
23
|
public Timestamp timestamp;
|
26
24
|
|
27
25
|
@Before
|
28
26
|
public void createResource()
|
29
27
|
{
|
30
28
|
timestamp = Timestamp.ofEpochSecond(1463084053, 500000000);
|
31
|
-
jruby = new ScriptingContainer();
|
32
29
|
}
|
33
30
|
|
34
31
|
@Test(expected = DataException.class)
|
@@ -53,7 +50,7 @@ public class TestTimestampCast
|
|
53
50
|
@Test
|
54
51
|
public void asString()
|
55
52
|
{
|
56
|
-
TimestampFormatter formatter = new TimestampFormatter(
|
53
|
+
TimestampFormatter formatter = new TimestampFormatter("%Y-%m-%d %H:%M:%S.%6N", DateTimeZone.UTC);
|
57
54
|
assertEquals("2016-05-12 20:14:13.500000", TimestampCast.asString(timestamp, formatter));
|
58
55
|
}
|
59
56
|
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-typecast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
|
14
|
+
name: bundler
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - ~>
|
17
18
|
- !ruby/object:Gem::Version
|
18
19
|
version: '1.0'
|
19
|
-
|
20
|
-
prerelease: false
|
21
|
-
type: :development
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
23
21
|
requirements:
|
24
22
|
- - ~>
|
25
23
|
- !ruby/object:Gem::Version
|
26
24
|
version: '1.0'
|
25
|
+
prerelease: false
|
26
|
+
type: :development
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
|
28
|
+
name: rake
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
31
|
- - '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '10.0'
|
33
|
-
|
34
|
-
prerelease: false
|
35
|
-
type: :development
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
37
35
|
requirements:
|
38
36
|
- - '>='
|
39
37
|
- !ruby/object:Gem::Version
|
40
38
|
version: '10.0'
|
39
|
+
prerelease: false
|
40
|
+
type: :development
|
41
41
|
description: A filter plugin for Embulk to cast column type.
|
42
42
|
email:
|
43
43
|
- sonots@gmail.com
|
@@ -88,8 +88,7 @@ files:
|
|
88
88
|
- src/test/java/org/embulk/filter/typecast/cast/TestTimestampCast.java
|
89
89
|
- classpath/accessors-smart-1.1.jar
|
90
90
|
- classpath/asm-5.0.3.jar
|
91
|
-
- classpath/
|
92
|
-
- classpath/embulk-filter-typecast-0.1.5.jar
|
91
|
+
- classpath/embulk-filter-typecast-0.2.0.jar
|
93
92
|
- classpath/json-smart-2.2.1.jar
|
94
93
|
- classpath/JsonPathCompiler-0.1.1.jar
|
95
94
|
- classpath/slf4j-api-1.7.21.jar
|