embulk 0.8.5-java → 0.8.6-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c3d7aa4421322670e6cc3add4163fc0a17c676a
4
- data.tar.gz: acfdf53810139a9883b86b1baab3f278bbf4b295
3
+ metadata.gz: e27277099e8cec884c8ab223f4368af3d98c7ff5
4
+ data.tar.gz: c5c0827a516e74a365f5ae68f608f664d102e8d8
5
5
  SHA512:
6
- metadata.gz: ebcdf5814a2c29fc29e3816f733d762428a4f229f2064ea750ada8eed8a0ad9d5184de54847dccbb13e5de8d29a6926991445206f9a00b3011f961205210dab1
7
- data.tar.gz: 8e354cd04b40444ccc79bd75a7804277756ed2458c25872db91970d94436282576fba2847723c6b66894984c7cd012500552fb9f19220a2b9bf5b776b355590c
6
+ metadata.gz: 16d5172543bb87fd3e1fac02ef70dc6ac6011c8432cd35d28d9202504a4e595642f3c56f38183b88ab9d17bf76d00e7bd582587959a5cde7050418fae52d9103
7
+ data.tar.gz: 267f539a6b85b605696f9042adc20b092151e90a66078eec52ea254aa182734ec7f7f7df46ab731757eab90e6220b34dfcaf63b79e2a8e7c6010c3261faca9ba
data/build.gradle CHANGED
@@ -16,10 +16,10 @@ def release_projects = [project(":embulk-core"), project(":embulk-standards")]
16
16
 
17
17
  allprojects {
18
18
  group = 'org.embulk'
19
- version = '0.8.5'
19
+ version = '0.8.6'
20
20
 
21
21
  ext {
22
- jrubyVersion = '9.0.4.0'
22
+ jrubyVersion = '9.0.5.0'
23
23
  }
24
24
 
25
25
  apply plugin: 'java'
@@ -38,7 +38,7 @@ dependencies {
38
38
  compile 'joda-time:joda-time:2.8.1'
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.1'
41
+ compile 'org.msgpack:msgpack-core:0.8.3'
42
42
 
43
43
  // For embulk/guess/charset.rb. See also embulk.gemspec
44
44
  compile 'com.ibm.icu:icu4j:54.1.1'
@@ -4,6 +4,7 @@ import org.embulk.config.Config;
4
4
  import org.embulk.config.ConfigSource;
5
5
  import org.embulk.config.Task;
6
6
  import org.embulk.config.TaskSource;
7
+ import org.embulk.spi.json.JsonParser;
7
8
  import org.embulk.spi.time.Timestamp;
8
9
  import org.embulk.spi.type.Type;
9
10
  import org.embulk.spi.Column;
@@ -56,6 +57,12 @@ public class MockParserPlugin implements ParserPlugin
56
57
  pageBuilder.setTimestamp(column,
57
58
  Timestamp.ofEpochMilli(678L));
58
59
  break;
60
+ case "json":
61
+ pageBuilder.setJson(
62
+ column,
63
+ new JsonParser().parse("{\"_c1\":true,\"_c2\":10,\"_c3\":\"embulk\",\"_c4\":{\"k\":\"v\"}}")
64
+ );
65
+ break;
59
66
  default:
60
67
  throw new IllegalStateException("Unknown type: "
61
68
  + type.getName());
@@ -121,7 +121,8 @@ public class TestFileInputRunner
121
121
  ImmutableMap.of("name", "col2", "type", "long", "option", ImmutableMap.of()),
122
122
  ImmutableMap.of("name", "col3", "type", "double", "option", ImmutableMap.of()),
123
123
  ImmutableMap.of("name", "col4", "type", "string", "option", ImmutableMap.of()),
124
- ImmutableMap.of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()))));
124
+ ImmutableMap.of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()),
125
+ ImmutableMap.of("name", "col6", "type", "json", "option", ImmutableMap.of()))));
125
126
 
126
127
  final MockPageOutput output = new MockPageOutput();
127
128
  runner.transaction(config, new InputPlugin.Control()
@@ -145,12 +146,13 @@ public class TestFileInputRunner
145
146
  List<Object[]> records = Pages.toObjects(schema, output.pages);
146
147
  assertEquals(2, records.size());
147
148
  for (Object[] record : records) {
148
- assertEquals(5, record.length);
149
+ assertEquals(6, record.length);
149
150
  assertEquals(true, record[0]);
150
151
  assertEquals(2L, record[1]);
151
152
  assertEquals(3.0D, (Double) record[2], 0.01D);
152
153
  assertEquals("45", record[3]);
153
154
  assertEquals(678L, ((Timestamp) record[4]).toEpochMilli());
155
+ assertEquals("{\"_c2\":10,\"_c1\":true,\"_c4\":{\"k\":\"v\"},\"_c3\":\"embulk\"}", record[5].toString());
154
156
  }
155
157
  }
156
158
 
@@ -171,7 +173,8 @@ public class TestFileInputRunner
171
173
  ImmutableMap.of("name", "col2", "type", "long", "option", ImmutableMap.of()),
172
174
  ImmutableMap.of("name", "col3", "type", "double", "option", ImmutableMap.of()),
173
175
  ImmutableMap.of("name", "col4", "type", "string", "option", ImmutableMap.of()),
174
- ImmutableMap.of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()))));
176
+ ImmutableMap.of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()),
177
+ ImmutableMap.of("name", "col6", "type", "json", "option", ImmutableMap.of()))));
175
178
 
176
179
  final MockPageOutput output = new MockPageOutput();
177
180
 
@@ -18,6 +18,11 @@ import org.junit.Test;
18
18
 
19
19
  import com.google.common.collect.ImmutableList;
20
20
  import com.google.common.collect.ImmutableMap;
21
+ import org.msgpack.value.ImmutableMapValue;
22
+ import static org.msgpack.value.ValueFactory.newBoolean;
23
+ import static org.msgpack.value.ValueFactory.newInteger;
24
+ import static org.msgpack.value.ValueFactory.newMap;
25
+ import static org.msgpack.value.ValueFactory.newString;
21
26
 
22
27
  public class TestFileOutputRunner
23
28
  {
@@ -110,7 +115,8 @@ public class TestFileOutputRunner
110
115
  ImmutableMap.<String,Object>of("name", "col2", "type", "long", "option", ImmutableMap.of()),
111
116
  ImmutableMap.<String,Object>of("name", "col3", "type", "double", "option", ImmutableMap.of()),
112
117
  ImmutableMap.<String,Object>of("name", "col4", "type", "string", "option", ImmutableMap.of()),
113
- ImmutableMap.<String,Object>of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()));
118
+ ImmutableMap.<String,Object>of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()),
119
+ ImmutableMap.<String,Object>of("name", "col6", "type", "json", "option", ImmutableMap.of()));
114
120
  ConfigSource config = Exec
115
121
  .newConfigSource()
116
122
  .set("type", "unused?")
@@ -128,10 +134,16 @@ public class TestFileOutputRunner
128
134
  1);
129
135
  boolean committed = false;
130
136
  try {
137
+ ImmutableMapValue jsonValue = newMap(
138
+ newString("_c1"), newBoolean(true),
139
+ newString("_c2"), newInteger(10),
140
+ newString("_c3"), newString("embulk"),
141
+ newString("_c4"), newMap(newString("k"), newString("v"))
142
+ );
131
143
  for (Page page : PageTestUtils.buildPage(
132
144
  runtime.getBufferAllocator(), schema, true, 2L,
133
- 3.0D, "45", Timestamp.ofEpochMilli(678L), true, 2L,
134
- 3.0D, "45", Timestamp.ofEpochMilli(678L))) {
145
+ 3.0D, "45", Timestamp.ofEpochMilli(678L), jsonValue, true, 2L,
146
+ 3.0D, "45", Timestamp.ofEpochMilli(678L), jsonValue)) {
135
147
  tran.add(page);
136
148
  }
137
149
  tran.commit();
@@ -154,6 +166,7 @@ public class TestFileOutputRunner
154
166
  assertEquals(3.0D, (Double) record.get(2), 0.1D);
155
167
  assertEquals("45", record.get(3));
156
168
  assertEquals(678L, ((Timestamp) record.get(4)).toEpochMilli());
169
+ assertEquals("{\"_c1\":true,\"_c2\":10,\"_c3\":\"embulk\",\"_c4\":{\"k\":\"v\"}}", record.get(5).toString());
157
170
  }
158
171
  }
159
172
 
@@ -168,7 +181,8 @@ public class TestFileOutputRunner
168
181
  ImmutableMap.<String,Object>of("name", "col2", "type", "long", "option", ImmutableMap.of()),
169
182
  ImmutableMap.<String,Object>of("name", "col3", "type", "double", "option", ImmutableMap.of()),
170
183
  ImmutableMap.<String,Object>of("name", "col4", "type", "string", "option", ImmutableMap.of()),
171
- ImmutableMap.<String,Object>of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()));
184
+ ImmutableMap.<String,Object>of("name", "col5", "type", "timestamp", "option", ImmutableMap.of()),
185
+ ImmutableMap.<String,Object>of("name", "col6", "type", "json", "option", ImmutableMap.of()));
172
186
  ConfigSource config = Exec
173
187
  .newConfigSource()
174
188
  .set("type", "unused?")
@@ -2,17 +2,25 @@ package org.embulk.spi;
2
2
 
3
3
  import static org.embulk.spi.type.Types.BOOLEAN;
4
4
  import static org.embulk.spi.type.Types.DOUBLE;
5
+ import static org.embulk.spi.type.Types.JSON;
5
6
  import static org.embulk.spi.type.Types.LONG;
6
7
  import static org.embulk.spi.type.Types.STRING;
7
8
  import static org.embulk.spi.type.Types.TIMESTAMP;
8
9
  import static org.junit.Assert.assertEquals;
9
10
  import static org.junit.Assert.assertFalse;
10
11
  import static org.junit.Assert.assertTrue;
12
+ import org.msgpack.value.ImmutableMapValue;
13
+ import static org.msgpack.value.ValueFactory.newBoolean;
14
+ import static org.msgpack.value.ValueFactory.newInteger;
15
+ import static org.msgpack.value.ValueFactory.newMap;
16
+ import static org.msgpack.value.ValueFactory.newString;
11
17
  import java.util.ArrayList;
12
18
  import java.util.List;
13
19
  import org.embulk.spi.time.Timestamp;
14
20
  import org.embulk.spi.Schema;
15
21
  import org.embulk.EmbulkTestRuntime;
22
+ import org.msgpack.value.ImmutableMapValue;
23
+ import org.msgpack.value.Value;
16
24
  import org.junit.After;
17
25
  import org.junit.Before;
18
26
  import org.junit.Rule;
@@ -124,6 +132,12 @@ public class TestPageBuilderReader
124
132
  Timestamp.ofEpochMilli(0), Timestamp.ofEpochMilli(10));
125
133
  }
126
134
 
135
+ @Test
136
+ public void testJson()
137
+ {
138
+ check(Schema.builder().add("col1", JSON).build(), getJsonSampleData());
139
+ }
140
+
127
141
  @Test
128
142
  public void testNull()
129
143
  {
@@ -133,9 +147,10 @@ public class TestPageBuilderReader
133
147
  .add("col3", LONG)
134
148
  .add("col3", BOOLEAN)
135
149
  .add("col2", TIMESTAMP)
150
+ .add("col4", JSON)
136
151
  .build(),
137
- null, null, null, null, null,
138
- null, null, null, null, null);
152
+ null, null, null, null, null, null,
153
+ null, null, null, null, null, null);
139
154
  }
140
155
 
141
156
  @Test
@@ -147,9 +162,10 @@ public class TestPageBuilderReader
147
162
  .add("col3", LONG)
148
163
  .add("col3", BOOLEAN)
149
164
  .add("col2", TIMESTAMP)
165
+ .add("col4", JSON)
150
166
  .build(),
151
- 8122.0, "val1", 3L, false, Timestamp.ofEpochMilli(0),
152
- 140.15, "val2", Long.MAX_VALUE, true, Timestamp.ofEpochMilli(10));
167
+ 8122.0, "val1", 3L, false, Timestamp.ofEpochMilli(0), getJsonSampleData(),
168
+ 140.15, "val2", Long.MAX_VALUE, true, Timestamp.ofEpochMilli(10), getJsonSampleData());
153
169
  }
154
170
 
155
171
  private void check(Schema schema, Object... objects)
@@ -185,6 +201,8 @@ public class TestPageBuilderReader
185
201
  builder.setString(column, (String) value);
186
202
  } else if (value instanceof Timestamp) {
187
203
  builder.setTimestamp(column, (Timestamp) value);
204
+ } else if (value instanceof Value) {
205
+ builder.setJson(column, (Value) value);
188
206
  } else {
189
207
  throw new IllegalStateException(
190
208
  "Unsupported type in test utils: "
@@ -218,6 +236,8 @@ public class TestPageBuilderReader
218
236
  assertEquals(value, reader.getString(column));
219
237
  } else if (value instanceof Timestamp) {
220
238
  assertEquals(value, reader.getTimestamp(column));
239
+ } else if (value instanceof Value) {
240
+ assertEquals(value, reader.getJson(column));
221
241
  } else {
222
242
  throw new IllegalStateException(
223
243
  "Unsupported type in test utils: "
@@ -227,6 +247,16 @@ public class TestPageBuilderReader
227
247
  }
228
248
  }
229
249
 
250
+ private ImmutableMapValue getJsonSampleData()
251
+ {
252
+ return newMap(
253
+ newString("_c1"), newBoolean(true),
254
+ newString("_c2"), newInteger(10),
255
+ newString("_c3"), newString("embulk"),
256
+ newString("_c4"), newMap(newString("k"), newString("v"))
257
+ );
258
+ }
259
+
230
260
  @Test
231
261
  public void testEmptySchema()
232
262
  {
@@ -4,6 +4,7 @@ Release Notes
4
4
  .. toctree::
5
5
  :maxdepth: 1
6
6
 
7
+ release/release-0.8.6
7
8
  release/release-0.8.5
8
9
  release/release-0.8.4
9
10
  release/release-0.8.3
@@ -0,0 +1,14 @@
1
+ Release 0.8.6
2
+ ==================================
3
+
4
+ General Changes
5
+ ------------------
6
+
7
+ * Upgraded JRuby from 9.0.4.0 to 9.0.5.0. See `JRuby 9.0.5.0 release notes <http://jruby.org/2016/01/26/jruby-9-0-5-0.html>`_ for details.
8
+
9
+ * Upgraded msgpack-java from 0.8.1 to 0.8.3. See `MessagePack Java release notes <https://github.com/msgpack/msgpack-java/blob/develop/RELEASE_NOTES.md>`_ for details.
10
+
11
+
12
+ Release Date
13
+ ------------------
14
+ 2016-02-24
@@ -156,7 +156,7 @@ public class TestJsonParserPlugin
156
156
  sb.append(line).append("\n");
157
157
  }
158
158
 
159
- ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes());
159
+ ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
160
160
  return new InputStreamFileInput(runtime.getBufferAllocator(), provider(in));
161
161
  }
162
162
 
@@ -1,3 +1,3 @@
1
1
  module Embulk
2
- VERSION = '0.8.5'
2
+ VERSION = '0.8.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
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-02-18 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -148,8 +148,8 @@ 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-core-0.8.5.jar
152
- - classpath/embulk-standards-0.8.5.jar
151
+ - classpath/embulk-core-0.8.6.jar
152
+ - classpath/embulk-standards-0.8.6.jar
153
153
  - classpath/guava-18.0.jar
154
154
  - classpath/guice-4.0.jar
155
155
  - classpath/guice-bootstrap-0.1.1.jar
@@ -165,7 +165,7 @@ files:
165
165
  - classpath/joda-time-2.8.1.jar
166
166
  - classpath/logback-classic-1.1.3.jar
167
167
  - classpath/logback-core-1.1.3.jar
168
- - classpath/msgpack-core-0.8.1.jar
168
+ - classpath/msgpack-core-0.8.3.jar
169
169
  - classpath/netty-buffer-5.0.0.Alpha1.jar
170
170
  - classpath/netty-common-5.0.0.Alpha1.jar
171
171
  - classpath/slf4j-api-1.7.12.jar
@@ -465,6 +465,7 @@ files:
465
465
  - embulk-docs/src/release/release-0.8.3.rst
466
466
  - embulk-docs/src/release/release-0.8.4.rst
467
467
  - embulk-docs/src/release/release-0.8.5.rst
468
+ - embulk-docs/src/release/release-0.8.6.rst
468
469
  - embulk-standards/build.gradle
469
470
  - embulk-standards/src/main/java/org/embulk/standards/Bzip2FileDecoderPlugin.java
470
471
  - embulk-standards/src/main/java/org/embulk/standards/Bzip2FileEncoderPlugin.java