red-arrow-duckdb 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: ac2fc2780b82eadb1ac59bbd1af1427ef6522c4ce97c4a51c8d3dbfe7181763f
4
- data.tar.gz: 4c75ea339bca32b4b3249faad455c7383ff700d7dd7d338804a91bd8ad4c46da
3
+ metadata.gz: c4e0bd37b9d6cdeb79f8b82668d0b074e1c4fa5acecbb88582fca04655373367
4
+ data.tar.gz: b9d5fdc73e4eb4a09ef5f46ea80b05750a3c75593fc4d8ead8c3f56991d70483
5
5
  SHA512:
6
- metadata.gz: a1963496e56b1868cac0c462758250110c4a95d3bc1f990cb67f7e26da11db2f85ebe1a3edfcf3109454ff43a8b4012b9fb807164eb6fd089fe0ee176ef6718b
7
- data.tar.gz: 637dd0226663c59358a13b6545544c49c149221d6e97b150d12751a50368e2c30dd8887e2b267728c10a0f228384fc17244ada2cf19cead1e8c51e5525ce32ca
6
+ metadata.gz: 65a8a8c0c9474a230dfee8a1a7731701d4d3ecdc22ef87b87d90ec5c2c91bd9cc2cb7ddd2dfe79f912ebb08d6db86888d5395709ea48fae6a77c531561b40e1a
7
+ data.tar.gz: 1e69ff5db5ca882c607ca20a024d63f096e893080779c4bcd2c43e96f5f2f98ac0f2cc2e77e7cdcd093a2739911c720686d4cffa27904c38841ddeb0dcf855f9
data/doc/text/news.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # News
2
2
 
3
+ ## 1.0.2 - 2022-03-06
4
+
5
+ ### Improvements
6
+
7
+ * Added support for timestamp value pushdown.
8
+ [GitHub#2](https://github.com/red-data-tools/red-arrow-duckdb/issues/2)
9
+ [Reported by Torsten Sprenger]
10
+
11
+ ### Thanks
12
+
13
+ * Torsten Sprenger
14
+
3
15
  ## 1.0.1 - 2021-11-06
4
16
 
5
17
  ### Improvements
@@ -7,7 +19,8 @@
7
19
  * macOS: Don't require specifying `PKG_CONFIG_PATH` on install such
8
20
  as `PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig gem
9
21
  install red-arrow-duckdb`.
10
- [GitHub#1][Reported by Konstantin Ilchenko]
22
+ [GitHub#1](https://github.com/red-data-tools/red-arrow-duckdb/issues/2)
23
+ [Reported by Konstantin Ilchenko]
11
24
 
12
25
  ### Thanks
13
26
 
@@ -35,6 +35,22 @@
35
35
  #include "arrow-duckdb-registration.hpp"
36
36
 
37
37
  namespace {
38
+ std::shared_ptr<arrow::Scalar>
39
+ convert_constant_timestamp(duckdb::Value &value, arrow::TimeUnit::type unit)
40
+ {
41
+ auto scalar_result =
42
+ arrow::MakeScalar(arrow::timestamp(unit), value.GetValue<int64_t>());
43
+ if (!scalar_result.ok()) {
44
+ throw duckdb::InvalidInputException(
45
+ "[arrow][filter][pushdown][%s] "
46
+ "failed to convert to Apache Arrow scalar: %s: <%s>",
47
+ value.type().ToString(),
48
+ scalar_result.status().ToString(),
49
+ value.ToString());
50
+ }
51
+ return *scalar_result;
52
+ }
53
+
38
54
  std::shared_ptr<arrow::Scalar>
39
55
  convert_constant(duckdb::Value &value)
40
56
  {
@@ -55,9 +71,14 @@ namespace {
55
71
  // return arrow::MakeScalar(arrow::date32(), value.GetValue<int32_t>());
56
72
  // case duckdb::LogicalTypeId::TIME:
57
73
  // return arrow::MakeScalar(arrow::time64(), value.GetValue<int64_t>());
58
- // case duckdb::LogicalTypeId::TIMESTAMP:
59
- // return arrow::MakeScalar(arrow::timestamp(),
60
- // value.GetValue<int64_t>());
74
+ case duckdb::LogicalTypeId::TIMESTAMP_SEC:
75
+ return convert_constant_timestamp(value, arrow::TimeUnit::SECOND);
76
+ case duckdb::LogicalTypeId::TIMESTAMP_MS:
77
+ return convert_constant_timestamp(value, arrow::TimeUnit::MILLI);
78
+ case duckdb::LogicalTypeId::TIMESTAMP:
79
+ return convert_constant_timestamp(value, arrow::TimeUnit::MICRO);
80
+ case duckdb::LogicalTypeId::TIMESTAMP_NS:
81
+ return convert_constant_timestamp(value, arrow::TimeUnit::NANO);
61
82
  case duckdb::LogicalTypeId::UTINYINT:
62
83
  return arrow::MakeScalar(value.GetValue<uint8_t>());
63
84
  case duckdb::LogicalTypeId::USMALLINT:
@@ -75,7 +96,7 @@ namespace {
75
96
  // case LogicalTypeId::DECIMAL:
76
97
  default:
77
98
  throw duckdb::NotImplementedException(
78
- "[arrow][filter][pushdown] not implemented value type: %s",
99
+ "[arrow][filter][pushdown][%s] not implemented value type",
79
100
  value.type().ToString());
80
101
  }
81
102
  }
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module ArrowDuckDB
16
- VERSION = "1.0.1"
16
+ VERSION = "1.0.2"
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-arrow-duckdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutou Kouhei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-05 00:00:00.000000000 Z
11
+ date: 2022-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: duckdb
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.3.0.dev
122
+ rubygems_version: 3.4.0.dev
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Red Arrow DuckDB is a library that provides Apache Arrow support to ruby-duckdb.