embulk-filter-row 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +6 -0
  4. data/README.md +1 -1
  5. data/build.gradle +3 -3
  6. data/example/and.yml +5 -6
  7. data/example/example.yml +37 -0
  8. data/example/or.yml +2 -1
  9. data/lib/embulk/filter/row.rb +1 -1
  10. data/src/main/java/org/embulk/filter/row/AbstractColumnVisitor.java +62 -0
  11. data/src/main/java/org/embulk/filter/row/ColumnVisitorAndImpl.java +211 -0
  12. data/src/main/java/org/embulk/filter/row/ColumnVisitorOrImpl.java +211 -0
  13. data/src/main/java/org/embulk/filter/row/RowFilterPlugin.java +106 -0
  14. data/src/main/java/org/embulk/filter/row/{BooleanCondition.java → condition/BooleanCondition.java} +1 -1
  15. data/src/main/java/org/embulk/filter/row/condition/Condition.java +5 -0
  16. data/src/main/java/org/embulk/filter/row/{ConditionConfig.java → condition/ConditionConfig.java} +1 -1
  17. data/src/main/java/org/embulk/filter/row/{ConditionFactory.java → condition/ConditionFactory.java} +1 -1
  18. data/src/main/java/org/embulk/filter/row/{DoubleCondition.java → condition/DoubleCondition.java} +1 -1
  19. data/src/main/java/org/embulk/filter/row/{LongCondition.java → condition/LongCondition.java} +1 -1
  20. data/src/main/java/org/embulk/filter/row/{StringCondition.java → condition/StringCondition.java} +1 -1
  21. data/src/main/java/org/embulk/filter/row/{TimestampCondition.java → condition/TimestampCondition.java} +2 -1
  22. data/src/test/java/org/embulk/filter/row/{TestBooleanCondition.java → condition/TestBooleanCondition.java} +1 -1
  23. data/src/test/java/org/embulk/filter/row/{TestConditionFactory.java → condition/TestConditionFactory.java} +1 -1
  24. data/src/test/java/org/embulk/filter/row/{TestDoubleCondition.java → condition/TestDoubleCondition.java} +1 -1
  25. data/src/test/java/org/embulk/filter/row/{TestLongCondition.java → condition/TestLongCondition.java} +1 -1
  26. data/src/test/java/org/embulk/filter/row/{TestStringCondition.java → condition/TestStringCondition.java} +1 -1
  27. data/src/test/java/org/embulk/filter/row/{TestTimestampCondition.java → condition/TestTimestampCondition.java} +1 -1
  28. metadata +22 -19
  29. data/src/main/java/org/embulk/filter/RowFilterPlugin.java +0 -464
  30. data/src/main/java/org/embulk/filter/row/Condition.java +0 -5
  31. data/src/test/java/org/embulk/filter/TestRowFilterPlugin.java +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dda5fc00e1df4e66e7c07fb98ffe1ed396c61544
4
- data.tar.gz: 515413bd3a2c4dbe123a4a00bbd079fceadf9eda
3
+ metadata.gz: e658f035d50a57d97df3a874a87754e0eafc3114
4
+ data.tar.gz: 505d52511a7527b4bab0585a075548af27ed0c7e
5
5
  SHA512:
6
- metadata.gz: aae0ff1567c1010542d9bcdc8c625d5e7679449254600552534dd3f3348cb719430a2ba0069587a3ff2b0d7c007ee3568f78fc5d72562eb06ff5ea3d0290ff45
7
- data.tar.gz: 200a1d796398224163afe1417b96820e1e21c563a4029c1d0a36981ed88467b9509abd64429e8d144a2e6598fced1269204966989cc0284739352f8e6f884343
6
+ metadata.gz: c0943ff3946f42199d898326419677f74d2b162a7d515b3ce6f6847b162b08e4469af946e42ddc61c50a4c0b3c6ca2b35530bc880a5531d60e3102c873c066a6
7
+ data.tar.gz: e21c28850e48e2d9d816ca8922e2ae7019cb2828976b99807f9f063190f492f89397e32b6648b2aeab4d0e20e08e3b66b987f66d606c121691c06c1be766a341
data/.gitignore CHANGED
@@ -9,3 +9,4 @@ build/
9
9
  *.csv
10
10
  .tags
11
11
  .ruby-version
12
+ *.iml
@@ -1,3 +1,9 @@
1
+ # 0.2.2 (2016-08-05)
2
+
3
+ Enhancements:
4
+
5
+ * Support `type: json` (not supporting filtering with json yet, though)
6
+
1
7
  # 0.2.1 (2016-06-27)
2
8
 
3
9
  Enhancements:
data/README.md CHANGED
@@ -96,7 +96,7 @@ Run example:
96
96
 
97
97
  ```
98
98
  $ ./gradlew classpath
99
- $ embulk run -I lib example/and.yml
99
+ $ embulk preview -I lib example/example.yml
100
100
  ```
101
101
 
102
102
  Run test:
@@ -13,13 +13,13 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.2.1"
16
+ version = "0.2.2"
17
17
  sourceCompatibility = 1.7
18
18
  targetCompatibility = 1.7
19
19
 
20
20
  dependencies {
21
- compile "org.embulk:embulk-core:0.7.0"
22
- provided "org.embulk:embulk-core:0.7.0"
21
+ compile "org.embulk:embulk-core:0.8.11"
22
+ provided "org.embulk:embulk-core:0.8.11"
23
23
  // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
24
24
  testCompile "junit:junit:4.+"
25
25
  }
@@ -12,7 +12,7 @@ in:
12
12
  type: csv
13
13
  charset: UTF-8
14
14
  newline: CRLF
15
- null_string: 'NULL'
15
+ null_string: "NULL"
16
16
  skip_header_lines: 1
17
17
  comment_line_marker: '#'
18
18
  columns:
@@ -22,17 +22,16 @@ in:
22
22
  - {name: flag, type: boolean}
23
23
  - {name: id, type: long}
24
24
  - {name: name, type: string}
25
+ - {name: json, type: json}
25
26
  - {name: score, type: double}
26
27
  filters:
27
28
  - type: row
28
29
  conditions:
29
- - {column: flag, operator: ==, argument: true}
30
- - {column: foo, operator: "IS NULL"}
31
- - {column: id, operator: ==, argument: 97}
32
- - {column: name, operator: ==, argument: "xxxx", not: true}
30
+ - {column: time, operator: ==, argument: "2015-07-13", format: "%Y-%m-%d"}
31
+ - {column: foo, operator: "IS NULL" }
32
+ - {column: bar, operator: ==, argument: "bar"}
33
33
  - {column: score, operator: ">", argument: 2000}
34
34
  - {column: score, operator: "<", argument: 6000}
35
- - {column: time, operator: ==, argument: "2015-07-13", format: "%Y-%m-%d"}
36
35
  # - {column: missing, operator: "==", argument: 6000}
37
36
  out:
38
37
  type: stdout
@@ -0,0 +1,37 @@
1
+ # in:
2
+ # type: random
3
+ # rows: 100
4
+ # schema:
5
+ # id: primary_key
6
+ # name: string
7
+ # score: integer
8
+ in:
9
+ type: file
10
+ path_prefix: example/example.csv
11
+ parser:
12
+ type: csv
13
+ charset: UTF-8
14
+ newline: CRLF
15
+ null_string: "NULL"
16
+ skip_header_lines: 1
17
+ comment_line_marker: '#'
18
+ columns:
19
+ - {name: time, type: timestamp, format: "%Y-%m-%d"}
20
+ - {name: foo, type: string}
21
+ - {name: bar, type: string}
22
+ - {name: flag, type: boolean}
23
+ - {name: id, type: long}
24
+ - {name: name, type: string}
25
+ - {name: json, type: json}
26
+ - {name: score, type: double}
27
+ filters:
28
+ - type: row
29
+ conditions:
30
+ - {column: time, operator: ==, argument: "2015-07-13", format: "%Y-%m-%d"}
31
+ - {column: foo, operator: "IS NULL" }
32
+ - {column: bar, operator: ==, argument: "bar"}
33
+ - {column: score, operator: ">", argument: 2000}
34
+ - {column: score, operator: "<", argument: 6000}
35
+ # - {column: missing, operator: "==", argument: 6000}
36
+ out:
37
+ type: stdout
@@ -15,6 +15,7 @@ in:
15
15
  - {name: flag, type: boolean}
16
16
  - {name: id, type: long}
17
17
  - {name: name, type: string}
18
+ - {name: json, type: json}
18
19
  - {name: score, type: double}
19
20
  filters:
20
21
  - type: row
@@ -22,7 +23,7 @@ filters:
22
23
  conditions:
23
24
  - {column: name, operator: ==, argument: "Vqjht6YEUBsMPXmoW1iOGFROZF27pBzz0TUkOKeDXEY"}
24
25
  - {column: score, operator: ==, argument: 43}
25
- - {column: id, operator: ==, argument: 97}
26
+ - {column: id, operator: ==, argument: 9}
26
27
  - {column: flag, operator: ==, argument: false}
27
28
  out:
28
29
  type: stdout
@@ -1,3 +1,3 @@
1
1
  Embulk::JavaPlugin.register_filter(
2
- "row", "org.embulk.filter.RowFilterPlugin",
2
+ "row", "org.embulk.filter.row.RowFilterPlugin",
3
3
  File.expand_path('../../../../classpath', __FILE__))
@@ -0,0 +1,62 @@
1
+ package org.embulk.filter.row;
2
+
3
+ import org.embulk.filter.row.RowFilterPlugin.PluginTask;
4
+ import org.embulk.filter.row.condition.Condition;
5
+
6
+ import org.embulk.filter.row.condition.ConditionConfig;
7
+ import org.embulk.filter.row.condition.ConditionFactory;
8
+ import org.embulk.spi.Column;
9
+ import org.embulk.spi.ColumnVisitor;
10
+ import org.embulk.spi.PageBuilder;
11
+ import org.embulk.spi.PageReader;
12
+ import org.embulk.spi.Schema;
13
+
14
+ import java.util.ArrayList;
15
+ import java.util.HashMap;
16
+ import java.util.List;
17
+
18
+ abstract class AbstractColumnVisitor
19
+ implements ColumnVisitor
20
+ {
21
+ final PluginTask task;
22
+ final Schema inputSchema;
23
+ final Schema outputSchema;
24
+ final PageReader pageReader;
25
+ final PageBuilder pageBuilder;
26
+ HashMap<String, List<Condition>> conditionMap;
27
+
28
+ AbstractColumnVisitor(PluginTask task, Schema inputSchema, Schema outputSchema, PageReader pageReader, PageBuilder pageBuilder)
29
+ {
30
+ this.task = task;
31
+ this.inputSchema = inputSchema;
32
+ this.outputSchema = outputSchema;
33
+ this.pageReader = pageReader;
34
+ this.pageBuilder = pageBuilder;
35
+
36
+ this.conditionMap = buildConditionMap(task, outputSchema);
37
+ }
38
+
39
+ static HashMap<String, List<Condition>> buildConditionMap(PluginTask task, Schema outputSchema)
40
+ {
41
+ HashMap<String, List<Condition>> conditionMap = new HashMap<>();
42
+ for (Column column : outputSchema.getColumns()) {
43
+ String columnName = column.getName();
44
+ conditionMap.put(columnName, new ArrayList<Condition>());
45
+ }
46
+
47
+ for (ConditionConfig conditionConfig : task.getConditions()) {
48
+ String columnName = conditionConfig.getColumn();
49
+ for (Column column : outputSchema.getColumns()) {
50
+ if (columnName.equals(column.getName())) {
51
+ ConditionFactory factory = new ConditionFactory(task.getJRuby(), column, conditionConfig);
52
+ Condition condition = factory.createCondition();
53
+ conditionMap.get(columnName).add(condition);
54
+ break;
55
+ }
56
+ }
57
+ }
58
+ return conditionMap;
59
+ }
60
+
61
+ abstract public boolean visitColumns(Schema schema);
62
+ }
@@ -0,0 +1,211 @@
1
+ package org.embulk.filter.row;
2
+
3
+ import org.embulk.filter.row.RowFilterPlugin.PluginTask;
4
+ import org.embulk.filter.row.condition.BooleanCondition;
5
+ import org.embulk.filter.row.condition.Condition;
6
+ import org.embulk.filter.row.condition.DoubleCondition;
7
+ import org.embulk.filter.row.condition.LongCondition;
8
+ import org.embulk.filter.row.condition.StringCondition;
9
+ import org.embulk.filter.row.condition.TimestampCondition;
10
+
11
+ import org.embulk.spi.Column;
12
+ import org.embulk.spi.Exec;
13
+ import org.embulk.spi.PageBuilder;
14
+ import org.embulk.spi.PageReader;
15
+ import org.embulk.spi.Schema;
16
+ import org.embulk.spi.time.Timestamp;
17
+
18
+ import org.slf4j.Logger;
19
+
20
+ import java.util.List;
21
+
22
+ class ColumnVisitorAndImpl extends AbstractColumnVisitor
23
+ {
24
+ private static final Logger logger = Exec.getLogger(RowFilterPlugin.class);
25
+ private boolean shouldAddRecord;
26
+
27
+ ColumnVisitorAndImpl(PluginTask task, Schema inputSchema, Schema outputSchema, PageReader pageReader, PageBuilder pageBuilder)
28
+ {
29
+ super(task, inputSchema, outputSchema, pageReader, pageBuilder);
30
+ }
31
+
32
+ public boolean visitColumns(Schema schema)
33
+ {
34
+ //Visitor objects are created for each thread :)
35
+ //System.out.println(String.format("thread_id:%d object_id:%d", Thread.currentThread().getId(), this.hashCode()));
36
+ shouldAddRecord = true;
37
+ for (Column column : schema.getColumns()) {
38
+ column.visit(this);
39
+ }
40
+ return shouldAddRecord;
41
+ }
42
+
43
+ @Override
44
+ public void booleanColumn(Column column)
45
+ {
46
+ if (!shouldAddRecord) {
47
+ return;
48
+ }
49
+ List<Condition> conditionList = conditionMap.get(column.getName());
50
+ for (Condition tempCondition : conditionList) {
51
+ BooleanCondition condition = (BooleanCondition) tempCondition;
52
+ if (pageReader.isNull(column)) {
53
+ if (!condition.compare(null)) {
54
+ shouldAddRecord = false;
55
+ break;
56
+ }
57
+ }
58
+ else {
59
+ boolean subject = pageReader.getBoolean(column);
60
+ if (!condition.compare(subject)) {
61
+ shouldAddRecord = false;
62
+ break;
63
+ }
64
+ }
65
+ }
66
+ if (pageReader.isNull(column)) {
67
+ pageBuilder.setNull(column);
68
+ }
69
+ else {
70
+ pageBuilder.setBoolean(column, pageReader.getBoolean(column));
71
+ }
72
+ }
73
+
74
+ @Override
75
+ public void longColumn(Column column)
76
+ {
77
+ if (!shouldAddRecord) {
78
+ return;
79
+ }
80
+ List<Condition> conditionList = conditionMap.get(column.getName());
81
+ for (Condition tempCondition : conditionList) {
82
+ LongCondition condition = (LongCondition) tempCondition;
83
+ if (pageReader.isNull(column)) {
84
+ if (!condition.compare(null)) {
85
+ shouldAddRecord = false;
86
+ break;
87
+ }
88
+ }
89
+ else {
90
+ long subject = pageReader.getLong(column);
91
+ if (!condition.compare(subject)) {
92
+ shouldAddRecord = false;
93
+ break;
94
+ }
95
+ }
96
+ }
97
+ if (pageReader.isNull(column)) {
98
+ pageBuilder.setNull(column);
99
+ }
100
+ else {
101
+ pageBuilder.setLong(column, pageReader.getLong(column));
102
+ }
103
+ }
104
+
105
+ @Override
106
+ public void doubleColumn(Column column)
107
+ {
108
+ if (!shouldAddRecord) {
109
+ return;
110
+ }
111
+ List<Condition> conditionList = conditionMap.get(column.getName());
112
+ for (Condition tempCondition : conditionList) {
113
+ DoubleCondition condition = (DoubleCondition) tempCondition;
114
+ if (pageReader.isNull(column)) {
115
+ if (!condition.compare(null)) {
116
+ shouldAddRecord = false;
117
+ break;
118
+ }
119
+ }
120
+ else {
121
+ double subject = pageReader.getDouble(column);
122
+ if (!condition.compare(subject)) {
123
+ shouldAddRecord = false;
124
+ break;
125
+ }
126
+ }
127
+ }
128
+ if (pageReader.isNull(column)) {
129
+ pageBuilder.setNull(column);
130
+ }
131
+ else {
132
+ pageBuilder.setDouble(column, pageReader.getDouble(column));
133
+ }
134
+ }
135
+
136
+ @Override
137
+ public void stringColumn(Column column)
138
+ {
139
+ if (!shouldAddRecord) {
140
+ return;
141
+ }
142
+ List<Condition> conditionList = conditionMap.get(column.getName());
143
+ for (Condition tempCondition : conditionList) {
144
+ StringCondition condition = (StringCondition) tempCondition;
145
+ if (pageReader.isNull(column)) {
146
+ if (!condition.compare(null)) {
147
+ shouldAddRecord = false;
148
+ break;
149
+ }
150
+ }
151
+ else {
152
+ String subject = pageReader.getString(column);
153
+ if (!condition.compare(subject)) {
154
+ shouldAddRecord = false;
155
+ break;
156
+ }
157
+ }
158
+ }
159
+ if (pageReader.isNull(column)) {
160
+ pageBuilder.setNull(column);
161
+ }
162
+ else {
163
+ pageBuilder.setString(column, pageReader.getString(column));
164
+ }
165
+ }
166
+
167
+ @Override
168
+ public void timestampColumn(Column column)
169
+ {
170
+ if (!shouldAddRecord) {
171
+ return;
172
+ }
173
+ List<Condition> conditionList = conditionMap.get(column.getName());
174
+ for (Condition tempCondition : conditionList) {
175
+ TimestampCondition condition = (TimestampCondition) tempCondition;
176
+ if (pageReader.isNull(column)) {
177
+ if (!condition.compare(null)) {
178
+ shouldAddRecord = false;
179
+ break;
180
+ }
181
+ }
182
+ else {
183
+ Timestamp subject = pageReader.getTimestamp(column);
184
+ if (!condition.compare(subject)) {
185
+ shouldAddRecord = false;
186
+ break;
187
+ }
188
+ }
189
+ }
190
+ if (pageReader.isNull(column)) {
191
+ pageBuilder.setNull(column);
192
+ }
193
+ else {
194
+ pageBuilder.setTimestamp(column, pageReader.getTimestamp(column));
195
+ }
196
+ }
197
+
198
+ @Override
199
+ public void jsonColumn(Column column)
200
+ {
201
+ if (!shouldAddRecord) {
202
+ return;
203
+ }
204
+ if (pageReader.isNull(column)) {
205
+ pageBuilder.setNull(column);
206
+ }
207
+ else {
208
+ pageBuilder.setJson(column, pageReader.getJson(column));
209
+ }
210
+ }
211
+ }
@@ -0,0 +1,211 @@
1
+ package org.embulk.filter.row;
2
+
3
+ import org.embulk.filter.row.RowFilterPlugin.PluginTask;
4
+ import org.embulk.filter.row.condition.BooleanCondition;
5
+ import org.embulk.filter.row.condition.Condition;
6
+ import org.embulk.filter.row.condition.DoubleCondition;
7
+ import org.embulk.filter.row.condition.LongCondition;
8
+ import org.embulk.filter.row.condition.StringCondition;
9
+ import org.embulk.filter.row.condition.TimestampCondition;
10
+
11
+ import org.embulk.spi.Column;
12
+ import org.embulk.spi.Exec;
13
+ import org.embulk.spi.PageBuilder;
14
+ import org.embulk.spi.PageReader;
15
+ import org.embulk.spi.Schema;
16
+ import org.embulk.spi.time.Timestamp;
17
+
18
+ import org.slf4j.Logger;
19
+
20
+ import java.util.List;
21
+
22
+ class ColumnVisitorOrImpl extends AbstractColumnVisitor
23
+ {
24
+ private static final Logger logger = Exec.getLogger(RowFilterPlugin.class);
25
+ private boolean shouldAddRecord;
26
+
27
+ ColumnVisitorOrImpl(PluginTask task, Schema inputSchema, Schema outputSchema, PageReader pageReader, PageBuilder pageBuilder)
28
+ {
29
+ super(task, inputSchema, outputSchema, pageReader, pageBuilder);
30
+ }
31
+
32
+ public boolean visitColumns(Schema schema)
33
+ {
34
+ //Visitor objects are created for each thread :)
35
+ //System.out.println(String.format("thread_id:%d object_id:%d", Thread.currentThread().getId(), this.hashCode()));
36
+ shouldAddRecord = false;
37
+ for (Column column : schema.getColumns()) {
38
+ column.visit(this);
39
+ }
40
+ return shouldAddRecord;
41
+ }
42
+
43
+ @Override
44
+ public void booleanColumn(Column column)
45
+ {
46
+ if (pageReader.isNull(column)) {
47
+ pageBuilder.setNull(column);
48
+ }
49
+ else {
50
+ pageBuilder.setBoolean(column, pageReader.getBoolean(column));
51
+ }
52
+ if (shouldAddRecord) {
53
+ return;
54
+ }
55
+ List<Condition> conditionList = conditionMap.get(column.getName());
56
+ for (Condition tempCondition : conditionList) {
57
+ BooleanCondition condition = (BooleanCondition) tempCondition;
58
+ if (pageReader.isNull(column)) {
59
+ if (condition.compare(null)) {
60
+ shouldAddRecord = true;
61
+ break;
62
+ }
63
+ }
64
+ else {
65
+ boolean subject = pageReader.getBoolean(column);
66
+ if (condition.compare(subject)) {
67
+ shouldAddRecord = true;
68
+ break;
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ @Override
75
+ public void longColumn(Column column)
76
+ {
77
+ if (pageReader.isNull(column)) {
78
+ pageBuilder.setNull(column);
79
+ }
80
+ else {
81
+ pageBuilder.setLong(column, pageReader.getLong(column));
82
+ }
83
+ if (shouldAddRecord) {
84
+ return;
85
+ }
86
+ List<Condition> conditionList = conditionMap.get(column.getName());
87
+ for (Condition tempCondition : conditionList) {
88
+ LongCondition condition = (LongCondition) tempCondition;
89
+ if (pageReader.isNull(column)) {
90
+ if (condition.compare(null)) {
91
+ shouldAddRecord = true;
92
+ break;
93
+ }
94
+ }
95
+ else {
96
+ long subject = pageReader.getLong(column);
97
+ if (condition.compare(subject)) {
98
+ shouldAddRecord = true;
99
+ break;
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ @Override
106
+ public void doubleColumn(Column column)
107
+ {
108
+ if (pageReader.isNull(column)) {
109
+ pageBuilder.setNull(column);
110
+ }
111
+ else {
112
+ pageBuilder.setDouble(column, pageReader.getDouble(column));
113
+ }
114
+ if (shouldAddRecord) {
115
+ return;
116
+ }
117
+ List<Condition> conditionList = conditionMap.get(column.getName());
118
+ for (Condition tempCondition : conditionList) {
119
+ DoubleCondition condition = (DoubleCondition) tempCondition;
120
+ if (pageReader.isNull(column)) {
121
+ if (condition.compare(null)) {
122
+ shouldAddRecord = true;
123
+ break;
124
+ }
125
+ }
126
+ else {
127
+ double subject = pageReader.getDouble(column);
128
+ if (condition.compare(subject)) {
129
+ shouldAddRecord = true;
130
+ break;
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ @Override
137
+ public void stringColumn(Column column)
138
+ {
139
+ if (pageReader.isNull(column)) {
140
+ pageBuilder.setNull(column);
141
+ }
142
+ else {
143
+ pageBuilder.setString(column, pageReader.getString(column));
144
+ }
145
+ if (shouldAddRecord) {
146
+ return;
147
+ }
148
+ List<Condition> conditionList = conditionMap.get(column.getName());
149
+ for (Condition tempCondition : conditionList) {
150
+ StringCondition condition = (StringCondition) tempCondition;
151
+ if (pageReader.isNull(column)) {
152
+ if (condition.compare(null)) {
153
+ shouldAddRecord = true;
154
+ break;
155
+ }
156
+ }
157
+ else {
158
+ String subject = pageReader.getString(column);
159
+ if (condition.compare(subject)) {
160
+ shouldAddRecord = true;
161
+ break;
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ @Override
168
+ public void timestampColumn(Column column)
169
+ {
170
+ if (pageReader.isNull(column)) {
171
+ pageBuilder.setNull(column);
172
+ }
173
+ else {
174
+ pageBuilder.setTimestamp(column, pageReader.getTimestamp(column));
175
+ }
176
+ if (shouldAddRecord) {
177
+ return;
178
+ }
179
+ List<Condition> conditionList = conditionMap.get(column.getName());
180
+ for (Condition tempCondition : conditionList) {
181
+ TimestampCondition condition = (TimestampCondition) tempCondition;
182
+ if (pageReader.isNull(column)) {
183
+ if (condition.compare(null)) {
184
+ shouldAddRecord = true;
185
+ break;
186
+ }
187
+ }
188
+ else {
189
+ Timestamp subject = pageReader.getTimestamp(column);
190
+ if (condition.compare(subject)) {
191
+ shouldAddRecord = true;
192
+ break;
193
+ }
194
+ }
195
+ }
196
+ }
197
+
198
+ @Override
199
+ public void jsonColumn(Column column)
200
+ {
201
+ if (!shouldAddRecord) {
202
+ return;
203
+ }
204
+ if (pageReader.isNull(column)) {
205
+ pageBuilder.setNull(column);
206
+ }
207
+ else {
208
+ pageBuilder.setJson(column, pageReader.getJson(column));
209
+ }
210
+ }
211
+ }