embulk-filter-row 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4362a57be3339dd46cc6be453703748c71755617
4
- data.tar.gz: 1c2b2044e7421793aac99c774010a6285e3ddc33
3
+ metadata.gz: 5339052a179409622158694483a27d6ab80f4a80
4
+ data.tar.gz: 0460d1d3511ca884042e60465b40d6a8d5e41bf0
5
5
  SHA512:
6
- metadata.gz: 71237877bcfbfeca795113e388268187bbcdec03d98d7e196d24db2fd046c71515765771d0162f0a253579c29cafad354c7b9e86357b4fdb35aa011394a1fb22
7
- data.tar.gz: 71a585f664ac93a3f82c726333b471e20e1377d7d21c7f685978a78324e22922ab24be634c01ca8466af2a3d8a74f017df00dc3f9b2c3085a767cd772bac5309
6
+ metadata.gz: 0b12e47564da7eabd58733723e463ac1da4523795905a19f9583839b5c3a51f2ea56230ea564d452d75c8bbf125a724497f462f4f0213ba6e82a250fa7ea4d92
7
+ data.tar.gz: b133c708497f4e78f09b35b35b8f11bb06d48bdf5ac5abe61ab7f9261d63abe98bb942a4c5f0bd55500516fb0076b0e7c35bbec59cf64da275999bc0fa23c5d0
@@ -1,3 +1,13 @@
1
+ # 0.3.2 (2016-08-08)
2
+
3
+ Changes
4
+
5
+ * `conditions` option is now deprecated. Show deprecation warning messages.
6
+
7
+ Fxies:
8
+
9
+ * Fix NullPointerException for `where` option
10
+
1
11
  # 0.3.1 (2016-08-08)
2
12
 
3
13
  Changes:
data/README.md CHANGED
@@ -6,6 +6,10 @@ A filter plugin for Embulk to filter out rows
6
6
 
7
7
  ## Configuration
8
8
 
9
+ * **where**: Write conditions with SQL-like syntax. See [SQL-like Syntax](#sql-like-syntax)
10
+
11
+ Following options are **deprecated**, and will be removed someday.
12
+
9
13
  * **condition**: AND or OR (string, default: AND).
10
14
  * **conditions**: select only rows which matches with conditions.
11
15
  * **column**: column name (string, required)
@@ -33,12 +37,13 @@ A filter plugin for Embulk to filter out rows
33
37
  * **not**: not (boolean, optional, default: false)
34
38
  * **format**: special option for timestamp column, specify the format of timestamp argument, parsed argument is compared with the column value as Timestamp object (string, default is `%Y-%m-%d %H:%M:%S.%N %z`)
35
39
  * **timezone**: special option for timestamp column, specify the timezone of timestamp argument (string, default is `UTC`)
36
- * **where** (experimental): Write conditions with SQL-like syntax. See [SQL-like Syntax](#sql-like-syntax)
37
40
 
38
41
  NOTE: column type is automatically retrieved from input data (inputSchema)
39
42
 
40
43
  ## Example (AND)
41
44
 
45
+ **Deprecated**
46
+
42
47
  ```yaml
43
48
  filters:
44
49
  - type: row
@@ -53,6 +58,8 @@ filters:
53
58
 
54
59
  ## Example (OR)
55
60
 
61
+ **Deprecated**
62
+
56
63
  ```yaml
57
64
  filters:
58
65
  - type: row
@@ -64,6 +71,8 @@ filters:
64
71
 
65
72
  ## Example (AND of OR)
66
73
 
74
+ **Deprecated**
75
+
67
76
  You can express a condition such as `(A OR B) AND (C OR D)` by combining multiple filters like
68
77
 
69
78
  ```yaml
@@ -80,7 +89,7 @@ filters:
80
89
  - {column: d, operator: "IS NOT NULL"}
81
90
  ```
82
91
 
83
- ## Example (WHERE) (Experimental)
92
+ ## Example (WHERE)
84
93
 
85
94
  Versions >= 0.3.0 suppors SQL-like syntax like
86
95
 
@@ -15,7 +15,7 @@ configurations {
15
15
  provided
16
16
  }
17
17
 
18
- version = "0.3.1"
18
+ version = "0.3.2"
19
19
  sourceCompatibility = 1.7
20
20
  targetCompatibility = 1.7
21
21
 
@@ -30,7 +30,6 @@ import java.util.List;
30
30
  public class RowFilterPlugin implements FilterPlugin
31
31
  {
32
32
  private static final Logger logger = Exec.getLogger(RowFilterPlugin.class);
33
- private ParserExp parserExp = null;
34
33
 
35
34
  public RowFilterPlugin() {}
36
35
 
@@ -38,10 +37,12 @@ public class RowFilterPlugin implements FilterPlugin
38
37
  {
39
38
  @Config("condition")
40
39
  @ConfigDefault("\"AND\"")
40
+ @Deprecated
41
41
  public String getCondition();
42
42
 
43
43
  @Config("conditions")
44
44
  @ConfigDefault("null")
45
+ @Deprecated
45
46
  public Optional<List<ConditionConfig>> getConditions();
46
47
 
47
48
  @Config("where")
@@ -65,6 +66,7 @@ public class RowFilterPlugin implements FilterPlugin
65
66
  void configure(PluginTask task, Schema inputSchema) throws ConfigException
66
67
  {
67
68
  if (task.getConditions().isPresent()) {
69
+ logger.warn("embulk-filter-row: \"conditions\" is deprecated, use \"where\" instead.");
68
70
  for (ConditionConfig conditionConfig : task.getConditions().get()) {
69
71
  String columnName = conditionConfig.getColumn();
70
72
  inputSchema.lookupColumn(columnName); // throw SchemaConfigException if not found
@@ -78,7 +80,8 @@ public class RowFilterPlugin implements FilterPlugin
78
80
  else if (task.getWhere().isPresent()) {
79
81
  String where = task.getWhere().get();
80
82
  Parser parser = new Parser(inputSchema);
81
- parserExp = parser.parse(where); // throw ConfigException if something wrong
83
+ // objects must be created in open since plugin instances in transaction and open are different
84
+ parser.parse(where); // throws ConfigException if something wrong
82
85
  }
83
86
  else {
84
87
  throw new ConfigException("Either of `conditions` or `where` must be set.");
@@ -96,6 +99,7 @@ public class RowFilterPlugin implements FilterPlugin
96
99
 
97
100
  final AbstractGuardColumnVisitor guradVisitor;
98
101
  if (task.getWhere().isPresent()) {
102
+ ParserExp parserExp = new Parser(inputSchema).parse(task.getWhere().get());
99
103
  guradVisitor = new GuardColumnVisitorWhereImpl(task, inputSchema, outputSchema, pageReader, parserExp);
100
104
  }
101
105
  else if (orCondition) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-filter-row
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
@@ -94,7 +94,7 @@ files:
94
94
  - src/test/java/org/embulk/filter/row/condition/TestTimestampCondition.java
95
95
  - src/test/java/org/embulk/filter/row/where/TestParser.java
96
96
  - src/test/java/org/embulk/filter/row/where/TestYylex.java
97
- - classpath/embulk-filter-row-0.3.1.jar
97
+ - classpath/embulk-filter-row-0.3.2.jar
98
98
  homepage: https://github.com/sonots/embulk-filter-row
99
99
  licenses:
100
100
  - MIT