Skip to content

Commit

Permalink
R-duckdb: update to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 authored and pmetzger committed Jun 15, 2024
1 parent 25f523c commit 2162f80
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 55 deletions.
9 changes: 5 additions & 4 deletions R/R-duckdb/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ PortGroup legacysupport 1.1
# _SC_PHYS_PAGES
legacysupport.newest_darwin_requires_legacy 15

R.setup cran duckdb duckdb 0.10.2
R.setup cran duckdb duckdb 1.0.0
revision 0
categories-append databases
maintainers nomaintainer
license MIT
description DBI package for the DuckDB database management system
long_description {*}${description}
homepage https://github.com/duckdb/duckdb-r
checksums rmd160 83751a632718218aaa8532408a8fd662dfaf3673 \
sha256 72e0b94b1cc321236fe95e0c3100017182bc5f22de816a1e18c4404b71a0cdd7 \
size 4205337
checksums rmd160 e5e356ef1c0f554960a928ec620b1a6609d5e176 \
sha256 a57eda804033f16a003443acb9939b1faa032822ff3ffb563bcd1cc7dcca0c22 \
size 4398683

depends_lib-append port:R-DBI

compiler.cxx_standard 2017

# https://github.com/duckdb/duckdb-r/issues/152
# Partly fixed, but a patch still needed.
patchfiles-append patch-fix-cmath.diff

if {${os.platform} eq "darwin" && ${os.major} < 16} {
Expand Down
8 changes: 4 additions & 4 deletions R/R-duckdb/files/patch-Makevars.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- src/Makevars 2024-04-30 10:20:53.000000000 +0800
+++ src/Makevars 2024-05-06 11:17:24.000000000 +0800
--- src/Makevars 2024-06-06 12:20:16.000000000 +0800
+++ src/Makevars 2024-06-15 02:01:56.000000000 +0800
@@ -15,5 +15,6 @@
include Makevars.duckdb

CXX_STD = CXX17
-PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -Iduckdb/src/include -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/fast_float -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/httplib -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/third_party/libpg_query -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/lz4 -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/miniz -Iduckdb/third_party/pcg -Iduckdb/third_party/re2 -Iduckdb/third_party/skiplist -Iduckdb/third_party/tdigest -Iduckdb/third_party/utf8proc -Iduckdb/third_party/utf8proc/include -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/lz4 -Iduckdb/third_party/snappy -Iduckdb/third_party/zstd/include -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY
-PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -Iduckdb/src/include -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/fast_float -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/httplib -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/third_party/libpg_query -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/lz4 -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/miniz -Iduckdb/third_party/pcg -Iduckdb/third_party/re2 -Iduckdb/third_party/skiplist -Iduckdb/third_party/tdigest -Iduckdb/third_party/utf8proc -Iduckdb/third_party/utf8proc/include -Iduckdb/third_party/yyjson/include -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/lz4 -Iduckdb/third_party/snappy -Iduckdb/third_party/zstd/include -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY
-OBJECTS=rfuns.o database.o connection.o statement.o register.o relational.o scan.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
+PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -Iduckdb/src/include -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/fast_float -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/httplib -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/third_party/libpg_query -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/lz4 -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/miniz -Iduckdb/third_party/pcg -Iduckdb/third_party/re2 -Iduckdb/third_party/skiplist -Iduckdb/third_party/tdigest -Iduckdb/third_party/utf8proc -Iduckdb/third_party/utf8proc/include -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/lz4 -Iduckdb/third_party/snappy -Iduckdb/third_party/zstd/include -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY @LEGACY_INC@
+PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -Iduckdb/src/include -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/fast_float -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/httplib -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/third_party/libpg_query -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/lz4 -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/miniz -Iduckdb/third_party/pcg -Iduckdb/third_party/re2 -Iduckdb/third_party/skiplist -Iduckdb/third_party/tdigest -Iduckdb/third_party/utf8proc -Iduckdb/third_party/utf8proc/include -Iduckdb/third_party/yyjson/include -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/lz4 -Iduckdb/third_party/snappy -Iduckdb/third_party/zstd/include -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY @LEGACY_INC@
+OBJECTS = rfuns.o database.o connection.o statement.o register.o relational.o scan.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
+PKG_LIBS = @LEGACY_LFLAG@ @ATOMIC@
59 changes: 12 additions & 47 deletions R/R-duckdb/files/patch-fix-cmath.diff
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
--- src/rfuns.cpp
+++ src/rfuns.cpp 2024-05-03 22:24:42.000000000 +0800
@@ -4,6 +4,7 @@

#include <math.h>
#include <climits>
+#include <cmath>

namespace duckdb {
namespace rfuns {
@@ -29,7 +30,7 @@

BinaryExecutor::ExecuteWithNulls<double, double, double>(
parts.lefts, parts.rights, result, args.size(), [&](double left, double right, ValidityMask &mask, idx_t idx) {
- if (isnan(left) || isnan(right)) {
+ if (std::isnan(left) || std::isnan(right)) {
mask.SetInvalid(idx);
return 0.0;
}
@@ -38,7 +39,7 @@
}

double ExecuteBaseRPlusFunctionIntDouble(int32_t left, double right, ValidityMask &mask, idx_t idx) {
- if (isnan(right)) {
+ if (std::isnan(right)) {
mask.SetInvalid(idx);
return 0.0;
}
@@ -108,7 +109,7 @@

template <>
int32_t cast<double>(double input, ValidityMask &mask, idx_t idx) {
- if (isnan(input)) {
+ if (std::isnan(input)) {
mask.SetInvalid(idx);
}
return check_range(input, mask, idx);
@@ -228,7 +229,7 @@
--- src/rfuns.cpp 2024-06-04 13:44:27.000000000 +0800
+++ src/rfuns.cpp 2024-06-15 03:49:59.000000000 +0800
@@ -247,7 +247,7 @@
if (ValidityMask::AllValid(validity_entry)) {
// all valid: check with isnan()
for (; base_idx < next; base_idx++) {
Expand All @@ -44,7 +9,7 @@
}
} else if (ValidityMask::NoneValid(validity_entry)) {
// None valid:
@@ -241,7 +242,7 @@
@@ -260,7 +260,7 @@
for (; base_idx < next; base_idx++) {
if (ValidityMask::RowIsValid(validity_entry, base_idx - start)) {
D_ASSERT(mask.RowIsValid(base_idx));
Expand All @@ -53,12 +18,12 @@
} else {
result_data[base_idx] = true;
}
@@ -627,7 +628,7 @@
@@ -292,7 +292,7 @@
auto result_data = ConstantVector::GetData<bool>(result);
auto ldata = ConstantVector::GetData<double>(input);

- *result_data = ConstantVector::IsNull(input) || isnan(*ldata);
+ *result_data = ConstantVector::IsNull(input) || std::isnan(*ldata);

template <>
bool set_null<double>(double value, ValidityMask &mask, idx_t idx) {
- if (isnan(value)) {
+ if (std::isnan(value)) {
mask.SetInvalid(idx);
return true;
}
break;
}

0 comments on commit 2162f80

Please sign in to comment.