embulk 0.8.8-java → 0.8.9-java
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/build.gradle +1 -1
- data/embulk-core/build.gradle +1 -1
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampParser.java +41 -3
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampFormatterParser.java +12 -0
- data/embulk-docs/src/release.rst +1 -0
- data/embulk-docs/src/release/release-0.8.9.rst +14 -0
- data/lib/embulk/command/embulk_example.rb +1 -0
- data/lib/embulk/data/bundle/.ruby-version +1 -1
- data/lib/embulk/data/bundle/Gemfile +1 -1
- data/lib/embulk/version.rb +1 -1
- metadata +37 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e829e27244a8c8062106d7ec34e96c82d5a019b5
|
4
|
+
data.tar.gz: bb725adf54901c11ffd03b3f49e458c326a6c999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9349de5e35792ae19c335e0dfea59455743b558f3532b45b47e3eec85faf3993ba77d3abfa873a7a28842ce62c163bf5b2c173ddba5f41c9ccc4c09fe48d04bd
|
7
|
+
data.tar.gz: 5685bbd5da78ccb4c6b651c9fe2a4747a51b857aec64dbda0014be635c9be2bf1fe1d6fa54d59ea681f5169d9f7a21271825ed8d9eaca6414a9382d82e62f931
|
data/build.gradle
CHANGED
data/embulk-core/build.gradle
CHANGED
@@ -38,7 +38,7 @@ dependencies {
|
|
38
38
|
compile 'joda-time:joda-time:2.9.2'
|
39
39
|
compile 'io.netty:netty-buffer:5.0.0.Alpha1'
|
40
40
|
compile 'org.fusesource.jansi:jansi:1.11'
|
41
|
-
compile 'org.msgpack:msgpack-core:0.8.
|
41
|
+
compile 'org.msgpack:msgpack-core:0.8.7'
|
42
42
|
|
43
43
|
// For embulk/guess/charset.rb. See also embulk.gemspec
|
44
44
|
compile 'com.ibm.icu:icu4j:54.1.1'
|
@@ -1,11 +1,18 @@
|
|
1
1
|
package org.embulk.spi.time;
|
2
2
|
|
3
|
+
import java.util.Date;
|
4
|
+
import java.util.Locale;
|
5
|
+
import java.util.TimeZone;
|
6
|
+
import java.util.Calendar;
|
7
|
+
import java.text.SimpleDateFormat;
|
8
|
+
import java.text.ParseException;
|
3
9
|
import org.joda.time.DateTimeZone;
|
4
10
|
import com.google.common.base.Optional;
|
5
11
|
import org.jruby.embed.ScriptingContainer;
|
6
12
|
import org.embulk.config.Config;
|
7
13
|
import org.embulk.config.ConfigInject;
|
8
14
|
import org.embulk.config.ConfigDefault;
|
15
|
+
import org.embulk.config.ConfigException;
|
9
16
|
import static org.embulk.spi.time.TimestampFormat.parseDateTimeZone;
|
10
17
|
|
11
18
|
public class TimestampParser
|
@@ -32,6 +39,10 @@ public class TimestampParser
|
|
32
39
|
@ConfigDefault("\"%Y-%m-%d %H:%M:%S.%N %z\"")
|
33
40
|
public String getDefaultTimestampFormat();
|
34
41
|
|
42
|
+
@Config("default_date")
|
43
|
+
@ConfigDefault("\"1970-01-01\"")
|
44
|
+
public String getDefaultDate();
|
45
|
+
|
35
46
|
@ConfigInject
|
36
47
|
public ScriptingContainer getJRuby();
|
37
48
|
}
|
@@ -45,6 +56,10 @@ public class TimestampParser
|
|
45
56
|
@Config("format")
|
46
57
|
@ConfigDefault("null")
|
47
58
|
public Optional<String> getFormat();
|
59
|
+
|
60
|
+
@Config("date")
|
61
|
+
@ConfigDefault("null")
|
62
|
+
public Optional<String> getDate();
|
48
63
|
}
|
49
64
|
|
50
65
|
private final JRubyTimeParserHelper helper;
|
@@ -58,21 +73,44 @@ public class TimestampParser
|
|
58
73
|
|
59
74
|
TimestampParser(Task task)
|
60
75
|
{
|
61
|
-
this(task.getJRuby(), task.getDefaultTimestampFormat(), task.getDefaultTimeZone());
|
76
|
+
this(task.getJRuby(), task.getDefaultTimestampFormat(), task.getDefaultTimeZone(), task.getDefaultDate());
|
62
77
|
}
|
63
78
|
|
64
79
|
public TimestampParser(Task task, TimestampColumnOption columnOption)
|
65
80
|
{
|
66
81
|
this(task.getJRuby(),
|
67
82
|
columnOption.getFormat().or(task.getDefaultTimestampFormat()),
|
68
|
-
columnOption.getTimeZone().or(task.getDefaultTimeZone())
|
83
|
+
columnOption.getTimeZone().or(task.getDefaultTimeZone()),
|
84
|
+
columnOption.getDate().or(task.getDefaultDate()));
|
69
85
|
}
|
70
86
|
|
71
87
|
public TimestampParser(ScriptingContainer jruby, String format, DateTimeZone defaultTimeZone)
|
88
|
+
{
|
89
|
+
this(jruby, format, defaultTimeZone, "1970-01-01");
|
90
|
+
}
|
91
|
+
|
92
|
+
public TimestampParser(ScriptingContainer jruby, String format, DateTimeZone defaultTimeZone, String defaultDate)
|
72
93
|
{
|
73
94
|
JRubyTimeParserHelperFactory helperFactory = (JRubyTimeParserHelperFactory) jruby.runScriptlet("Embulk::Java::TimeParserHelper::Factory.new");
|
95
|
+
|
96
|
+
// calculate default date
|
97
|
+
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
|
98
|
+
df.setTimeZone(TimeZone.getTimeZone("UTC"));
|
99
|
+
Date utc;
|
100
|
+
try {
|
101
|
+
utc = df.parse(defaultDate);
|
102
|
+
}
|
103
|
+
catch (ParseException ex) {
|
104
|
+
throw new ConfigException("Invalid date format. Expected yyyy-MM-dd: " + defaultDate);
|
105
|
+
}
|
106
|
+
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.ENGLISH);
|
107
|
+
cal.setTime(utc);
|
108
|
+
int year = cal.get(Calendar.YEAR);
|
109
|
+
int month = cal.get(Calendar.MONTH) + 1;
|
110
|
+
int day = cal.get(Calendar.DAY_OF_MONTH);
|
111
|
+
|
74
112
|
// TODO get default current time from ExecTask.getExecTimestamp
|
75
|
-
this.helper = (JRubyTimeParserHelper) helperFactory.newInstance(format,
|
113
|
+
this.helper = (JRubyTimeParserHelper) helperFactory.newInstance(format, year, month, day, 0, 0, 0, 0); // TODO default time zone
|
76
114
|
this.defaultTimeZone = defaultTimeZone;
|
77
115
|
}
|
78
116
|
|
@@ -60,4 +60,16 @@ public class TestTimestampFormatterParser
|
|
60
60
|
TimestampParser parser = new TimestampParser(ptask);
|
61
61
|
assertEquals(Timestamp.ofEpochSecond(1416365189), parser.parse("1416365189"));
|
62
62
|
}
|
63
|
+
|
64
|
+
@Test
|
65
|
+
public void testDefaultDate() throws Exception
|
66
|
+
{
|
67
|
+
ConfigSource config = Exec.newConfigSource()
|
68
|
+
.set("default_timestamp_format", "%H:%M:%S %Z")
|
69
|
+
.set("default_date", "2016-02-03");
|
70
|
+
|
71
|
+
ParserTestTask ptask = config.loadConfig(ParserTestTask.class);
|
72
|
+
TimestampParser parser = new TimestampParser(ptask);
|
73
|
+
assertEquals(Timestamp.ofEpochSecond(1454467589, 0), parser.parse("02:46:29 +0000"));
|
74
|
+
}
|
63
75
|
}
|
data/embulk-docs/src/release.rst
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
Release 0.8.9
|
2
|
+
==================================
|
3
|
+
|
4
|
+
General Changes
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Added ``date:`` option to timestamp parser. If format doesn't include date part, date option is used as the default date. For example, parsing text "02:46:29" with ``format: %H:%M:%S`` and ``date: 2016-02-03`` options returns "2016-02-03 02:46:29".
|
8
|
+
|
9
|
+
* Upgraded msgpack-core version from 0.8.6 to 0.8.7. Release notes of msgpack-java: https://github.com/msgpack/msgpack-java/blob/develop/RELEASE_NOTES.md
|
10
|
+
|
11
|
+
|
12
|
+
Release Date
|
13
|
+
------------------
|
14
|
+
2016-05-12
|
@@ -1 +1 @@
|
|
1
|
-
jruby-9.0.
|
1
|
+
jruby-9.0.5.0
|
data/lib/embulk/version.rb
CHANGED
metadata
CHANGED
@@ -1,127 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.9
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.10.6
|
14
20
|
requirement: !ruby/object:Gem::Requirement
|
15
21
|
requirements:
|
16
22
|
- - ">="
|
17
23
|
- !ruby/object:Gem::Version
|
18
24
|
version: 1.10.6
|
19
|
-
name: bundler
|
20
25
|
prerelease: false
|
21
26
|
type: :runtime
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: msgpack
|
22
29
|
version_requirements: !ruby/object:Gem::Requirement
|
23
30
|
requirements:
|
24
|
-
- - "
|
31
|
+
- - "~>"
|
25
32
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
-
- !ruby/object:Gem::Dependency
|
33
|
+
version: 0.7.3
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
29
35
|
requirements:
|
30
36
|
- - "~>"
|
31
37
|
- !ruby/object:Gem::Version
|
32
38
|
version: 0.7.3
|
33
|
-
name: msgpack
|
34
39
|
prerelease: false
|
35
40
|
type: :runtime
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: liquid
|
36
43
|
version_requirements: !ruby/object:Gem::Requirement
|
37
44
|
requirements:
|
38
45
|
- - "~>"
|
39
46
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
41
|
-
- !ruby/object:Gem::Dependency
|
47
|
+
version: 3.0.6
|
42
48
|
requirement: !ruby/object:Gem::Requirement
|
43
49
|
requirements:
|
44
50
|
- - "~>"
|
45
51
|
- !ruby/object:Gem::Version
|
46
52
|
version: 3.0.6
|
47
|
-
name: liquid
|
48
53
|
prerelease: false
|
49
54
|
type: :runtime
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rjack-icu
|
50
57
|
version_requirements: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
59
|
- - "~>"
|
53
60
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
- !ruby/object:Gem::Dependency
|
61
|
+
version: 4.54.1.1
|
56
62
|
requirement: !ruby/object:Gem::Requirement
|
57
63
|
requirements:
|
58
64
|
- - "~>"
|
59
65
|
- !ruby/object:Gem::Version
|
60
66
|
version: 4.54.1.1
|
61
|
-
name: rjack-icu
|
62
67
|
prerelease: false
|
63
68
|
type: :runtime
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
64
71
|
version_requirements: !ruby/object:Gem::Requirement
|
65
72
|
requirements:
|
66
|
-
- - "
|
73
|
+
- - ">="
|
67
74
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
-
- !ruby/object:Gem::Dependency
|
75
|
+
version: 0.10.0
|
70
76
|
requirement: !ruby/object:Gem::Requirement
|
71
77
|
requirements:
|
72
78
|
- - ">="
|
73
79
|
- !ruby/object:Gem::Version
|
74
80
|
version: 0.10.0
|
75
|
-
name: rake
|
76
81
|
prerelease: false
|
77
82
|
type: :development
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: test-unit
|
78
85
|
version_requirements: !ruby/object:Gem::Requirement
|
79
86
|
requirements:
|
80
|
-
- - "
|
87
|
+
- - "~>"
|
81
88
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
83
|
-
- !ruby/object:Gem::Dependency
|
89
|
+
version: 3.0.9
|
84
90
|
requirement: !ruby/object:Gem::Requirement
|
85
91
|
requirements:
|
86
92
|
- - "~>"
|
87
93
|
- !ruby/object:Gem::Version
|
88
94
|
version: 3.0.9
|
89
|
-
name: test-unit
|
90
95
|
prerelease: false
|
91
96
|
type: :development
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
92
99
|
version_requirements: !ruby/object:Gem::Requirement
|
93
100
|
requirements:
|
94
101
|
- - "~>"
|
95
102
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
- !ruby/object:Gem::Dependency
|
103
|
+
version: 0.8.7
|
98
104
|
requirement: !ruby/object:Gem::Requirement
|
99
105
|
requirements:
|
100
106
|
- - "~>"
|
101
107
|
- !ruby/object:Gem::Version
|
102
108
|
version: 0.8.7
|
103
|
-
name: yard
|
104
109
|
prerelease: false
|
105
110
|
type: :development
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: kramdown
|
106
113
|
version_requirements: !ruby/object:Gem::Requirement
|
107
114
|
requirements:
|
108
115
|
- - "~>"
|
109
116
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
-
- !ruby/object:Gem::Dependency
|
117
|
+
version: 1.5.0
|
112
118
|
requirement: !ruby/object:Gem::Requirement
|
113
119
|
requirements:
|
114
120
|
- - "~>"
|
115
121
|
- !ruby/object:Gem::Version
|
116
122
|
version: 1.5.0
|
117
|
-
name: kramdown
|
118
123
|
prerelease: false
|
119
124
|
type: :development
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 1.5.0
|
125
125
|
description: Embulk is an open-source, plugin-based bulk data loader to scale and simplify data management across heterogeneous data stores. It can collect and ship any kinds of data in high throughput with transaction control.
|
126
126
|
email:
|
127
127
|
- frsyuki@gmail.com
|
@@ -148,9 +148,9 @@ files:
|
|
148
148
|
- classpath/commons-beanutils-core-1.8.3.jar
|
149
149
|
- classpath/commons-compress-1.10.jar
|
150
150
|
- classpath/commons-lang3-3.1.jar
|
151
|
-
- classpath/embulk-cli-0.8.
|
152
|
-
- classpath/embulk-core-0.8.
|
153
|
-
- classpath/embulk-standards-0.8.
|
151
|
+
- classpath/embulk-cli-0.8.9.jar
|
152
|
+
- classpath/embulk-core-0.8.9.jar
|
153
|
+
- classpath/embulk-standards-0.8.9.jar
|
154
154
|
- classpath/guava-18.0.jar
|
155
155
|
- classpath/guice-4.0.jar
|
156
156
|
- classpath/guice-bootstrap-0.1.1.jar
|
@@ -166,7 +166,7 @@ files:
|
|
166
166
|
- classpath/joda-time-2.9.2.jar
|
167
167
|
- classpath/logback-classic-1.1.3.jar
|
168
168
|
- classpath/logback-core-1.1.3.jar
|
169
|
-
- classpath/msgpack-core-0.8.
|
169
|
+
- classpath/msgpack-core-0.8.7.jar
|
170
170
|
- classpath/netty-buffer-5.0.0.Alpha1.jar
|
171
171
|
- classpath/netty-common-5.0.0.Alpha1.jar
|
172
172
|
- classpath/slf4j-api-1.7.12.jar
|
@@ -469,6 +469,7 @@ files:
|
|
469
469
|
- embulk-docs/src/release/release-0.8.6.rst
|
470
470
|
- embulk-docs/src/release/release-0.8.7.rst
|
471
471
|
- embulk-docs/src/release/release-0.8.8.rst
|
472
|
+
- embulk-docs/src/release/release-0.8.9.rst
|
472
473
|
- embulk-standards/build.gradle
|
473
474
|
- embulk-standards/src/main/java/org/embulk/standards/Bzip2FileDecoderPlugin.java
|
474
475
|
- embulk-standards/src/main/java/org/embulk/standards/Bzip2FileEncoderPlugin.java
|