embulk-filter-calcite 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.travis.yml +4 -0
  4. data/CHANGELOG.md +3 -0
  5. data/README.md +61 -0
  6. data/build.gradle +112 -0
  7. data/config/checkstyle/checkstyle.xml +128 -0
  8. data/config/checkstyle/default.xml +108 -0
  9. data/gradle/wrapper/gradle-wrapper.jar +0 -0
  10. data/gradle/wrapper/gradle-wrapper.properties +6 -0
  11. data/gradlew +160 -0
  12. data/gradlew.bat +90 -0
  13. data/lib/embulk/filter/calcite.rb +3 -0
  14. data/src/main/java/org/embulk/filter/calcite/CalciteFilterPlugin.java +309 -0
  15. data/src/main/java/org/embulk/filter/calcite/PageConverter.java +119 -0
  16. data/src/main/java/org/embulk/filter/calcite/adapter/page/PageEnumerator.java +56 -0
  17. data/src/main/java/org/embulk/filter/calcite/adapter/page/PageFieldType.java +44 -0
  18. data/src/main/java/org/embulk/filter/calcite/adapter/page/PageSchema.java +26 -0
  19. data/src/main/java/org/embulk/filter/calcite/adapter/page/PageSchemaFactory.java +26 -0
  20. data/src/main/java/org/embulk/filter/calcite/adapter/page/PageTable.java +69 -0
  21. data/src/main/java/org/embulk/filter/calcite/getter/FilterColumnGetterFactory.java +45 -0
  22. data/src/main/java/org/embulk/filter/calcite/getter/UTCTimestampColumnGetter.java +41 -0
  23. data/src/test/java/org/embulk/filter/calcite/TestCalciteFilterPlugin.java +96 -0
  24. data/src/test/resources/org/embulk/filter/calcite/test/test_int_ops_expected.csv +4 -0
  25. data/src/test/resources/org/embulk/filter/calcite/test/test_int_ops_filter.yml +2 -0
  26. data/src/test/resources/org/embulk/filter/calcite/test/test_int_ops_in.yml +18 -0
  27. data/src/test/resources/org/embulk/filter/calcite/test/test_int_ops_source.csv +5 -0
  28. data/src/test/resources/org/embulk/filter/calcite/test/test_simple_expected.csv +4 -0
  29. data/src/test/resources/org/embulk/filter/calcite/test/test_simple_filter.yml +2 -0
  30. data/src/test/resources/org/embulk/filter/calcite/test/test_simple_in.yml +18 -0
  31. data/src/test/resources/org/embulk/filter/calcite/test/test_simple_source.csv +5 -0
  32. data/src/test/resources/org/embulk/filter/calcite/test/test_string_ops_expected.csv +4 -0
  33. data/src/test/resources/org/embulk/filter/calcite/test/test_string_ops_filter.yml +2 -0
  34. data/src/test/resources/org/embulk/filter/calcite/test/test_string_ops_in.yml +18 -0
  35. data/src/test/resources/org/embulk/filter/calcite/test/test_string_ops_source.csv +5 -0
  36. data/src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_expected.csv +2 -0
  37. data/src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_filter.yml +2 -0
  38. data/src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_in.yml +18 -0
  39. data/src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_source.csv +5 -0
  40. data/src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_expected.csv +2 -0
  41. data/src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_filter.yml +2 -0
  42. data/src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_in.yml +18 -0
  43. data/src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_source.csv +5 -0
  44. metadata +137 -0
@@ -0,0 +1,2 @@
1
+ type: calcite
2
+ query: 'SELECT id, id + 2, (id + 1) * id FROM $PAGES'
@@ -0,0 +1,18 @@
1
+ type: file
2
+ parser:
3
+ charset: UTF-8
4
+ newline: LF
5
+ type: csv
6
+ delimiter: ','
7
+ quote: '"'
8
+ escape: '"'
9
+ trim_if_not_quoted: false
10
+ skip_header_lines: 1
11
+ allow_extra_columns: false
12
+ allow_optional_columns: false
13
+ columns:
14
+ - {name: id, type: long}
15
+ - {name: account, type: long}
16
+ - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
17
+ - {name: purchase, type: string}
18
+ - {name: comment, type: string}
@@ -0,0 +1,5 @@
1
+ id,account,time,purchase,comment
2
+ 1,32864,2015-01-27 19:23:49,20150127,embulk
3
+ 2,14824,2015-01-27 19:01:23,20150127,embulk jruby
4
+ 3,27559,2015-01-28 02:20:02,20150128,"Embulk ""csv"" parser plugin"
5
+ 4,11270,2015-01-29 11:54:36,20150129,NULL
@@ -0,0 +1,4 @@
1
+ 1,32864,2015-01-27 19:23:49.000000 +0000,20150127,embulk
2
+ 2,14824,2015-01-27 19:01:23.000000 +0000,20150127,embulk jruby
3
+ 3,27559,2015-01-28 02:20:02.000000 +0000,20150128,"Embulk ""csv"" parser plugin"
4
+ 4,11270,2015-01-29 11:54:36.000000 +0000,20150129,NULL
@@ -0,0 +1,2 @@
1
+ type: calcite
2
+ query: 'SELECT * FROM $PAGES'
@@ -0,0 +1,18 @@
1
+ type: file
2
+ parser:
3
+ charset: UTF-8
4
+ newline: LF
5
+ type: csv
6
+ delimiter: ','
7
+ quote: '"'
8
+ escape: '"'
9
+ trim_if_not_quoted: false
10
+ skip_header_lines: 1
11
+ allow_extra_columns: false
12
+ allow_optional_columns: false
13
+ columns:
14
+ - {name: id, type: long}
15
+ - {name: account, type: long}
16
+ - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
17
+ - {name: purchase, type: string}
18
+ - {name: comment, type: string}
@@ -0,0 +1,5 @@
1
+ id,account,time,purchase,comment
2
+ 1,32864,2015-01-27 19:23:49,20150127,embulk
3
+ 2,14824,2015-01-27 19:01:23,20150127,embulk jruby
4
+ 3,27559,2015-01-28 02:20:02,20150128,"Embulk ""csv"" parser plugin"
5
+ 4,11270,2015-01-29 11:54:36,20150129,NULL
@@ -0,0 +1,4 @@
1
+ 20150127,2015012720150127,8,0150127,0150
2
+ 20150127,2015012720150127,8,0150127,0150
3
+ 20150128,2015012820150128,8,0150128,0150
4
+ 20150129,2015012920150129,8,0150129,0150
@@ -0,0 +1,2 @@
1
+ type: calcite
2
+ query: 'SELECT purchase, purchase || purchase, CHAR_LENGTH(purchase), SUBSTRING(purchase FROM 2), SUBSTRING(purchase FROM 2 FOR 4) FROM $PAGES'
@@ -0,0 +1,18 @@
1
+ type: file
2
+ parser:
3
+ charset: UTF-8
4
+ newline: LF
5
+ type: csv
6
+ delimiter: ','
7
+ quote: '"'
8
+ escape: '"'
9
+ trim_if_not_quoted: false
10
+ skip_header_lines: 1
11
+ allow_extra_columns: false
12
+ allow_optional_columns: false
13
+ columns:
14
+ - {name: id, type: long}
15
+ - {name: account, type: long}
16
+ - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
17
+ - {name: purchase, type: string}
18
+ - {name: comment, type: string}
@@ -0,0 +1,5 @@
1
+ id,account,time,purchase,comment
2
+ 1,32864,2015-01-27 19:23:49,20150127,embulk
3
+ 2,14824,2015-01-27 19:01:23,20150127,embulk jruby
4
+ 3,27559,2015-01-28 02:20:02,20150128,"Embulk ""csv"" parser plugin"
5
+ 4,11270,2015-01-29 11:54:36,20150129,NULL
@@ -0,0 +1,2 @@
1
+ 2,14824,2015-01-27 19:01:23.000000 +0000,20150127,embulk jruby
2
+ 4,11270,2015-01-29 11:54:36.000000 +0000,20150129,NULL
@@ -0,0 +1,2 @@
1
+ type: calcite
2
+ query: 'SELECT * FROM $PAGES WHERE MOD(id, 2) = 0'
@@ -0,0 +1,18 @@
1
+ type: file
2
+ parser:
3
+ charset: UTF-8
4
+ newline: LF
5
+ type: csv
6
+ delimiter: ','
7
+ quote: '"'
8
+ escape: '"'
9
+ trim_if_not_quoted: false
10
+ skip_header_lines: 1
11
+ allow_extra_columns: false
12
+ allow_optional_columns: false
13
+ columns:
14
+ - {name: id, type: long}
15
+ - {name: account, type: long}
16
+ - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
17
+ - {name: purchase, type: string}
18
+ - {name: comment, type: string}
@@ -0,0 +1,5 @@
1
+ id,account,time,purchase,comment
2
+ 1,32864,2015-01-27 19:23:49,20150127,embulk
3
+ 2,14824,2015-01-27 19:01:23,20150127,embulk jruby
4
+ 3,27559,2015-01-28 02:20:02,20150128,"Embulk ""csv"" parser plugin"
5
+ 4,11270,2015-01-29 11:54:36,20150129,NULL
@@ -0,0 +1,2 @@
1
+ 1,32864,2015-01-27 19:23:49.000000 +0000,20150127,embulk
2
+ 2,14824,2015-01-27 19:01:23.000000 +0000,20150127,embulk jruby
@@ -0,0 +1,2 @@
1
+ type: calcite
2
+ query: SELECT * FROM $PAGES WHERE purchase LIKE '%0127'
@@ -0,0 +1,18 @@
1
+ type: file
2
+ parser:
3
+ charset: UTF-8
4
+ newline: LF
5
+ type: csv
6
+ delimiter: ','
7
+ quote: '"'
8
+ escape: '"'
9
+ trim_if_not_quoted: false
10
+ skip_header_lines: 1
11
+ allow_extra_columns: false
12
+ allow_optional_columns: false
13
+ columns:
14
+ - {name: id, type: long}
15
+ - {name: account, type: long}
16
+ - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
17
+ - {name: purchase, type: string}
18
+ - {name: comment, type: string}
@@ -0,0 +1,5 @@
1
+ id,account,time,purchase,comment
2
+ 1,32864,2015-01-27 19:23:49,20150127,embulk
3
+ 2,14824,2015-01-27 19:01:23,20150127,embulk jruby
4
+ 3,27559,2015-01-28 02:20:02,20150128,"Embulk ""csv"" parser plugin"
5
+ 4,11270,2015-01-29 11:54:36,20150129,NULL
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: embulk-filter-calcite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Muga Nishizawa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: '1.0'
19
+ name: bundler
20
+ prerelease: false
21
+ type: :development
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '10.0'
33
+ name: rake
34
+ prerelease: false
35
+ type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Translate schema and column values by SQL-like query provided by Apache Calcite.
42
+ email:
43
+ - muga.nishizawa@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - .travis.yml
50
+ - CHANGELOG.md
51
+ - README.md
52
+ - build.gradle
53
+ - config/checkstyle/checkstyle.xml
54
+ - config/checkstyle/default.xml
55
+ - gradle/wrapper/gradle-wrapper.jar
56
+ - gradle/wrapper/gradle-wrapper.properties
57
+ - gradlew
58
+ - gradlew.bat
59
+ - lib/embulk/filter/calcite.rb
60
+ - src/main/java/org/embulk/filter/calcite/CalciteFilterPlugin.java
61
+ - src/main/java/org/embulk/filter/calcite/PageConverter.java
62
+ - src/main/java/org/embulk/filter/calcite/adapter/page/PageEnumerator.java
63
+ - src/main/java/org/embulk/filter/calcite/adapter/page/PageFieldType.java
64
+ - src/main/java/org/embulk/filter/calcite/adapter/page/PageSchema.java
65
+ - src/main/java/org/embulk/filter/calcite/adapter/page/PageSchemaFactory.java
66
+ - src/main/java/org/embulk/filter/calcite/adapter/page/PageTable.java
67
+ - src/main/java/org/embulk/filter/calcite/getter/FilterColumnGetterFactory.java
68
+ - src/main/java/org/embulk/filter/calcite/getter/UTCTimestampColumnGetter.java
69
+ - src/test/java/org/embulk/filter/calcite/TestCalciteFilterPlugin.java
70
+ - src/test/resources/org/embulk/filter/calcite/test/test_int_ops_expected.csv
71
+ - src/test/resources/org/embulk/filter/calcite/test/test_int_ops_filter.yml
72
+ - src/test/resources/org/embulk/filter/calcite/test/test_int_ops_in.yml
73
+ - src/test/resources/org/embulk/filter/calcite/test/test_int_ops_source.csv
74
+ - src/test/resources/org/embulk/filter/calcite/test/test_simple_expected.csv
75
+ - src/test/resources/org/embulk/filter/calcite/test/test_simple_filter.yml
76
+ - src/test/resources/org/embulk/filter/calcite/test/test_simple_in.yml
77
+ - src/test/resources/org/embulk/filter/calcite/test/test_simple_source.csv
78
+ - src/test/resources/org/embulk/filter/calcite/test/test_string_ops_expected.csv
79
+ - src/test/resources/org/embulk/filter/calcite/test/test_string_ops_filter.yml
80
+ - src/test/resources/org/embulk/filter/calcite/test/test_string_ops_in.yml
81
+ - src/test/resources/org/embulk/filter/calcite/test/test_string_ops_source.csv
82
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_expected.csv
83
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_filter.yml
84
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_in.yml
85
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_int_cond_source.csv
86
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_expected.csv
87
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_filter.yml
88
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_in.yml
89
+ - src/test/resources/org/embulk/filter/calcite/test/test_where_string_cond_source.csv
90
+ - classpath/aggdesigner-algorithm-6.0.jar
91
+ - classpath/avatica-core-1.9.0.jar
92
+ - classpath/avatica-metrics-1.9.0.jar
93
+ - classpath/calcite-core-1.11.0.jar
94
+ - classpath/calcite-linq4j-1.11.0.jar
95
+ - classpath/commons-codec-1.9.jar
96
+ - classpath/commons-compiler-2.7.6.jar
97
+ - classpath/commons-dbcp-1.4.jar
98
+ - classpath/commons-lang-2.4.jar
99
+ - classpath/commons-lang3-3.2.jar
100
+ - classpath/commons-logging-1.2.jar
101
+ - classpath/commons-pool-1.5.4.jar
102
+ - classpath/embulk-filter-calcite-0.1.0.jar
103
+ - classpath/embulk-input-jdbc-0.8.2.jar
104
+ - classpath/httpclient-4.5.2.jar
105
+ - classpath/httpcore-4.4.4.jar
106
+ - classpath/jackson-annotations-2.6.3.jar
107
+ - classpath/jackson-core-2.6.3.jar
108
+ - classpath/jackson-databind-2.6.3.jar
109
+ - classpath/janino-2.7.6.jar
110
+ - classpath/jsr305-1.3.9.jar
111
+ - classpath/protobuf-java-3.1.0.jar
112
+ - classpath/slf4j-api-1.7.13.jar
113
+ homepage: https://github.com/muga/embulk-filter-calcite
114
+ licenses:
115
+ - Apache 2.0
116
+ metadata: {}
117
+ post_install_message:
118
+ rdoc_options: []
119
+ require_paths:
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ requirements: []
132
+ rubyforge_project:
133
+ rubygems_version: 2.1.9
134
+ signing_key:
135
+ specification_version: 4
136
+ summary: Apache Calcite filter plugin for Embulk
137
+ test_files: []