embulk-filter-add_time 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47c3533da9505293335ec892ae49e06b462f3b39
|
4
|
+
data.tar.gz: 3332208c1f09e1b0da0d2d9638730083f679159d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcd078c499649c2ae4be4e2c527626058cf9cad68511385e269535b25835dde192e2744340014eef1833aaeb1848e31d0c1447c6af8286641d935e7795ec91aa
|
7
|
+
data.tar.gz: 64cfc9c742ff32955508ffe75dd8a83e393102bcb6c80db7b45bf0869a5e6b5863d0d34e8694d596c5e12ff157c60256e1d807e731ef6707fe11b3d755e3adfb
|
data/CHANGELOG.md
CHANGED
data/build.gradle
CHANGED
@@ -50,6 +50,9 @@ public class SchemaConverter
|
|
50
50
|
if (!fromColumnConfig.isPresent() && !fromValueConfig.isPresent()) {
|
51
51
|
throw new ConfigException("Setting from_column or from_value is required.");
|
52
52
|
}
|
53
|
+
if (fromColumnConfig.isPresent() && !hasColumn(fromColumnConfig.get().getName(), inputSchema)) {
|
54
|
+
throw new ConfigException(String.format("from_column '%s' doesn't exist in the schema.", fromColumnConfig.get().getName()));
|
55
|
+
}
|
53
56
|
|
54
57
|
converters = new ColumnConverter[inputSchema.size() + 1];
|
55
58
|
|
@@ -102,6 +105,16 @@ public class SchemaConverter
|
|
102
105
|
}
|
103
106
|
}
|
104
107
|
|
108
|
+
private static boolean hasColumn(String columnName, Schema schema)
|
109
|
+
{
|
110
|
+
for (Column c : schema.getColumns()) {
|
111
|
+
if (c.getName().equals(columnName)) {
|
112
|
+
return true;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
return false;
|
116
|
+
}
|
117
|
+
|
105
118
|
private static String newColumnUniqueName(String originalName, Schema schema)
|
106
119
|
{
|
107
120
|
String name = originalName;
|
@@ -61,6 +61,14 @@ public class TestSchemaConverter
|
|
61
61
|
failSchemaConverterCreation(log, conf, schema("c0", Types.TIMESTAMP));
|
62
62
|
}
|
63
63
|
|
64
|
+
// the column specified as from_column doesn't exist in the schema, throws ConfigException
|
65
|
+
{
|
66
|
+
ConfigSource conf = this.config.deepCopy()
|
67
|
+
.set("to_column", ImmutableMap.of("name", "time"))
|
68
|
+
.set("from_column", ImmutableMap.of("name", "c1"));;
|
69
|
+
failSchemaConverterCreation(log, conf, schema("c0", Types.TIMESTAMP));
|
70
|
+
}
|
71
|
+
|
64
72
|
// if from_value type is not string or long, throws ConfigException
|
65
73
|
{
|
66
74
|
ConfigSource conf = this.config.deepCopy()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-add_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muga Nishizawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,7 +79,7 @@ files:
|
|
79
79
|
- src/main/java/org/embulk/filter/add_time/reader/TimestampColumnReader.java
|
80
80
|
- src/test/java/org/embulk/filter/add_time/TestAddTimeFilterPlugin.java
|
81
81
|
- src/test/java/org/embulk/filter/add_time/converter/TestSchemaConverter.java
|
82
|
-
- classpath/embulk-filter-add_time-0.1.
|
82
|
+
- classpath/embulk-filter-add_time-0.1.1.jar
|
83
83
|
homepage: https://github.com/treasure-data/embulk-filter-add_time
|
84
84
|
licenses:
|
85
85
|
- Apache 2.0
|