Skip to content

Commit

Permalink
Merge branch 'ARROW-38457' of https://github.com/R-JunmingChen/arrow
Browse files Browse the repository at this point in the history
…into ARROW-38457
  • Loading branch information
R-JunmingChen committed Nov 16, 2023
2 parents ed46f28 + 3c0b315 commit 18a7cd9
Show file tree
Hide file tree
Showing 261 changed files with 12,843 additions and 2,782 deletions.
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ github:
- davisusanibar
- felipecrv
- js8544
- amoeba

notifications:
commits: [email protected]
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cpp/src/generated/*.cpp linguist-generated=true
cpp/src/generated/*.h linguist-generated=true
go/**/*.s linguist-generated=true
go/arrow/unionmode_string.go linguist-generated=true
go/arrow/internal/flatbuf/*.go linguist-generated=true
go/**/*.pb.go linguist-generated=true
go/parquet/internal/gen-go/parquet/*.go linguist-generated=true
r/R/RcppExports.R linguist-generated=true
r/R/arrowExports.R linguist-generated=true
r/src/RcppExports.cpp linguist-generated=true
Expand Down
23 changes: 4 additions & 19 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,17 @@ env:

jobs:

debian:
name: ${{ matrix.title }}
ubuntu:
name: AMD64 Ubuntu 22.04 Java JDK ${{ matrix.jdk }} Maven ${{ matrix.maven }}
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
jdk: [8, 11, 17, 21]
include:
- jdk: 8
title: AMD64 Debian 9 Java JDK 8 Maven 3.5.4
maven: 3.5.4
image: debian-java
- jdk: 11
title: AMD64 Debian 9 Java JDK 11 Maven 3.6.2
maven: 3.6.2
image: debian-java
- jdk: 17
title: AMD64 Ubuntu 22.04 Java JDK 17 Maven 3.9.4
maven: 3.9.4
image: eclipse-java
- jdk: 21
title: AMD64 Ubuntu 22.04 Java JDK 21 Maven 3.9.4
maven: 3.9.4
image: eclipse-java
maven: [3.9.5]
image: [java]
env:
JDK: ${{ matrix.jdk }}
MAVEN: ${{ matrix.maven }}
Expand Down
23 changes: 23 additions & 0 deletions c_glib/arrow-glib/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@
# define GARROW_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor)
#endif

/**
* GARROW_VERSION_15_0:
*
* You can use this macro value for compile time API version check.
*
* Since: 15.0.0
*/
#define GARROW_VERSION_15_0 G_ENCODE_VERSION(15, 0)

/**
* GARROW_VERSION_14_0:
*
Expand Down Expand Up @@ -346,6 +355,20 @@

#define GARROW_AVAILABLE_IN_ALL

#if GARROW_VERSION_MIN_REQUIRED >= GARROW_VERSION_15_0
# define GARROW_DEPRECATED_IN_15_0 GARROW_DEPRECATED
# define GARROW_DEPRECATED_IN_15_0_FOR(function) GARROW_DEPRECATED_FOR(function)
#else
# define GARROW_DEPRECATED_IN_15_0
# define GARROW_DEPRECATED_IN_15_0_FOR(function)
#endif

#if GARROW_VERSION_MAX_ALLOWED < GARROW_VERSION_15_0
# define GARROW_AVAILABLE_IN_15_0 GARROW_UNAVAILABLE(15, 0)
#else
# define GARROW_AVAILABLE_IN_15_0
#endif

#if GARROW_VERSION_MIN_REQUIRED >= GARROW_VERSION_14_0
# define GARROW_DEPRECATED_IN_14_0 GARROW_DEPRECATED
# define GARROW_DEPRECATED_IN_14_0_FOR(function) GARROW_DEPRECATED_FOR(function)
Expand Down
4 changes: 4 additions & 0 deletions c_glib/doc/gandiva-glib/gandiva-glib-docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-15-0-0" role="15.0.0">
<title>Index of new symbols in 15.0.0</title>
<xi:include href="xml/api-index-15.0.0.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-4-0-0" role="4.0.0">
<title>Index of new symbols in 4.0.0</title>
<xi:include href="xml/api-index-4.0.0.xml"><xi:fallback /></xi:include>
Expand Down
118 changes: 101 additions & 17 deletions c_glib/gandiva-glib/function-registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

#include <gandiva/function_registry.h>
#include <gandiva-glib/function-registry.h>

#include <gandiva-glib/function-registry.hpp>
#include <gandiva-glib/function-signature.hpp>
#include <gandiva-glib/native-function.hpp>

Expand All @@ -34,18 +34,86 @@ G_BEGIN_DECLS
* Since: 0.14.0
*/

G_DEFINE_TYPE(GGandivaFunctionRegistry,
ggandiva_function_registry,
G_TYPE_OBJECT)
struct GGandivaFunctionRegistryPrivate {
std::shared_ptr<gandiva::FunctionRegistry> function_registry;
};

enum {
PROP_FUNCTION_REGISTRY = 1,
};

G_DEFINE_TYPE_WITH_PRIVATE(GGandivaFunctionRegistry,
ggandiva_function_registry,
G_TYPE_OBJECT)

#define GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object) \
static_cast<GGandivaFunctionRegistryPrivate *>( \
ggandiva_function_registry_get_instance_private( \
GGANDIVA_FUNCTION_REGISTRY(object)))

static void
ggandiva_function_registry_finalize(GObject *object)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object);
priv->function_registry.~shared_ptr();
G_OBJECT_CLASS(ggandiva_function_registry_parent_class)->finalize(object);
}

static void
ggandiva_function_registry_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object);

switch (prop_id) {
case PROP_FUNCTION_REGISTRY:
priv->function_registry =
*static_cast<std::shared_ptr<gandiva::FunctionRegistry> *>(
g_value_get_pointer(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}

static void
ggandiva_function_registry_init(GGandivaFunctionRegistry *object)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object);
new(&priv->function_registry) std::shared_ptr<gandiva::FunctionRegistry>;
}

static void
ggandiva_function_registry_class_init(GGandivaFunctionRegistryClass *klass)
{
auto gobject_class = G_OBJECT_CLASS(klass);
gobject_class->finalize = ggandiva_function_registry_finalize;
gobject_class->set_property = ggandiva_function_registry_set_property;

GParamSpec *spec;
spec = g_param_spec_pointer("function-registry",
"Function registry",
"The raw std::shared_ptr<gandiva::FunctionRegistry> *",
static_cast<GParamFlags>(G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(gobject_class, PROP_FUNCTION_REGISTRY, spec);
}

/**
* ggandiva_function_registry_default:
*
* Returns: (transfer full): The process-wide default function registry.
*
* Since: 15.0.0
*/
GGandivaFunctionRegistry *
ggandiva_function_registry_default(void)
{
auto gandiva_function_registry = gandiva::default_function_registry();
return ggandiva_function_registry_new_raw(&gandiva_function_registry);
}

/**
Expand All @@ -58,7 +126,8 @@ ggandiva_function_registry_class_init(GGandivaFunctionRegistryClass *klass)
GGandivaFunctionRegistry *
ggandiva_function_registry_new(void)
{
return GGANDIVA_FUNCTION_REGISTRY(g_object_new(GGANDIVA_TYPE_FUNCTION_REGISTRY, NULL));
auto gandiva_function_registry = std::make_shared<gandiva::FunctionRegistry>();
return ggandiva_function_registry_new_raw(&gandiva_function_registry);
}

/**
Expand All @@ -75,15 +144,16 @@ GGandivaNativeFunction *
ggandiva_function_registry_lookup(GGandivaFunctionRegistry *function_registry,
GGandivaFunctionSignature *function_signature)
{
gandiva::FunctionRegistry gandiva_function_registry;
auto gandiva_function_registry =
ggandiva_function_registry_get_raw(function_registry);
auto gandiva_function_signature =
ggandiva_function_signature_get_raw(function_signature);
auto gandiva_native_function =
gandiva_function_registry.LookupSignature(*gandiva_function_signature);
gandiva_function_registry->LookupSignature(*gandiva_function_signature);
if (gandiva_native_function) {
return ggandiva_native_function_new_raw(gandiva_native_function);
} else {
return NULL;
return nullptr;
}
}

Expand All @@ -99,18 +169,32 @@ ggandiva_function_registry_lookup(GGandivaFunctionRegistry *function_registry,
GList *
ggandiva_function_registry_get_native_functions(GGandivaFunctionRegistry *function_registry)
{
gandiva::FunctionRegistry gandiva_function_registry;

auto gandiva_function_registry =
ggandiva_function_registry_get_raw(function_registry);
GList *native_functions = nullptr;
for (auto gandiva_native_function = gandiva_function_registry.begin();
gandiva_native_function != gandiva_function_registry.end();
++gandiva_native_function) {
auto native_function = ggandiva_native_function_new_raw(gandiva_native_function);
for (const auto &gandiva_native_function : *gandiva_function_registry) {
auto native_function = ggandiva_native_function_new_raw(&gandiva_native_function);
native_functions = g_list_prepend(native_functions, native_function);
}
native_functions = g_list_reverse(native_functions);

return native_functions;
return g_list_reverse(native_functions);
}

G_END_DECLS

GGandivaFunctionRegistry *
ggandiva_function_registry_new_raw(
std::shared_ptr<gandiva::FunctionRegistry> *gandiva_function_registry)
{
return GGANDIVA_FUNCTION_REGISTRY(
g_object_new(GGANDIVA_TYPE_FUNCTION_REGISTRY,
"function-registry", gandiva_function_registry,
nullptr));
}

std::shared_ptr<gandiva::FunctionRegistry>
ggandiva_function_registry_get_raw(GGandivaFunctionRegistry *function_registry)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(function_registry);
return priv->function_registry;
}

2 changes: 2 additions & 0 deletions c_glib/gandiva-glib/function-registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ struct _GGandivaFunctionRegistryClass
GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_15_0
GGandivaFunctionRegistry *ggandiva_function_registry_default(void);
GGandivaFunctionRegistry *ggandiva_function_registry_new(void);
GGandivaNativeFunction *
ggandiva_function_registry_lookup(GGandivaFunctionRegistry *function_registry,
Expand Down
30 changes: 30 additions & 0 deletions c_glib/gandiva-glib/function-registry.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#pragma once

#include <gandiva/function_registry.h>

#include <gandiva-glib/function-registry.h>

GGandivaFunctionRegistry *
ggandiva_function_registry_new_raw(
std::shared_ptr<gandiva::FunctionRegistry> *gandiva_function_registry);
std::shared_ptr<gandiva::FunctionRegistry>
ggandiva_function_registry_get_raw(GGandivaFunctionRegistry *function_registry);
2 changes: 1 addition & 1 deletion c_glib/test/gandiva/test-function-registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestGandivaFunctionRegistry < Test::Unit::TestCase

def setup
omit("Gandiva is required") unless defined?(::Gandiva)
@registry = Gandiva::FunctionRegistry.new
@registry = Gandiva::FunctionRegistry.default
end

sub_test_case("lookup") do
Expand Down
2 changes: 1 addition & 1 deletion c_glib/test/gandiva/test-native-function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestGandivaNativeFunction < Test::Unit::TestCase

def setup
omit("Gandiva is required") unless defined?(::Gandiva)
@registry = Gandiva::FunctionRegistry.new
@registry = Gandiva::FunctionRegistry.default
@not = lookup("not", [boolean_data_type], boolean_data_type)
@isnull = lookup("isnull", [int8_data_type], boolean_data_type)
end
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/python_wheel_macos_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rm -rf ${source_dir}/python/pyarrow/*.so.*

echo "=== (${PYTHON_VERSION}) Set SDK, C++ and Wheel flags ==="
export _PYTHON_HOST_PLATFORM="macosx-${MACOSX_DEPLOYMENT_TARGET}-${arch}"
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-10.14}
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-10.15}
export SDKROOT=${SDKROOT:-$(xcrun --sdk macosx --show-sdk-path)}

if [ $arch = "arm64" ]; then
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/r_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pushd ${source_dir}
printenv

# Run the nixlibs.R test suite, which is not included in the installed package
${R_BIN} -e 'setwd("tools"); testthat::test_dir(".")'
${R_BIN} -e 'setwd("tools"); testthat::test_dir(".", stop_on_warning = TRUE)'

# Before release, we always copy the relevant parts of the cpp source into the
# package. In some CI checks, we will use this version of the source:
Expand Down
3 changes: 0 additions & 3 deletions ci/scripts/util_free_space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ du -hsc /usr/local/*
echo "::endgroup::"
# ~1GB
sudo rm -rf \
/usr/local/aws-cli \
/usr/local/aws-sam-cil \
/usr/local/julia* || :
echo "::group::/usr/local/bin/*"
Expand All @@ -34,8 +33,6 @@ echo "::endgroup::"
# ~1GB (From 1.2GB to 214MB)
sudo rm -rf \
/usr/local/bin/aliyun \
/usr/local/bin/aws \
/usr/local/bin/aws_completer \
/usr/local/bin/azcopy \
/usr/local/bin/bicep \
/usr/local/bin/cmake-gui \
Expand Down
2 changes: 1 addition & 1 deletion ci/vcpkg/universal2-osx-static-debug.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64")
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.14")
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.15")

set(VCPKG_BUILD_TYPE debug)
2 changes: 1 addition & 1 deletion ci/vcpkg/universal2-osx-static-release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64")
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.14")
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.15")

set(VCPKG_BUILD_TYPE release)
Loading

0 comments on commit 18a7cd9

Please sign in to comment.